mirror of
				https://github.com/discourse/discourse.git
				synced 2025-02-25 18:55:32 -06:00 
			
		
		
		
	REFACTOR: upload workflow creation into UploadCreator
- Automatically convert large-ish PNG/BMP to JPEG - Updated fast_image to latest version
This commit is contained in:
		@@ -1,4 +1,5 @@
 | 
			
		||||
require_dependency 'git_importer'
 | 
			
		||||
require_dependency 'upload_creator'
 | 
			
		||||
 | 
			
		||||
class RemoteTheme < ActiveRecord::Base
 | 
			
		||||
 | 
			
		||||
@@ -50,7 +51,7 @@ class RemoteTheme < ActiveRecord::Base
 | 
			
		||||
 | 
			
		||||
    theme_info["assets"]&.each do |name, relative_path|
 | 
			
		||||
      if path = importer.real_path(relative_path)
 | 
			
		||||
        upload = Upload.create_for(theme.user_id, File.open(path), File.basename(relative_path), File.size(path), for_theme: true)
 | 
			
		||||
        upload = UploadCreator.new(File.open(path), File.basename(relative_path), for_theme: true).create_for(theme.user_id)
 | 
			
		||||
        theme.set_field(target: :common, name: name, type: :theme_upload_var, upload_id: upload.id)
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user