summaryrefslogtreecommitdiff
path: root/app/services/upload_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/upload_service.rb')
-rw-r--r--app/services/upload_service.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/app/services/upload_service.rb b/app/services/upload_service.rb
index 47903eb48c3..41ca95b3b6f 100644
--- a/app/services/upload_service.rb
+++ b/app/services/upload_service.rb
@@ -1,8 +1,6 @@
# frozen_string_literal: true
class UploadService
- attr_accessor :uploader
-
def initialize(model, file, uploader_class = FileUploader, **uploader_context)
@model, @file, @uploader_class, @uploader_context = model, file, uploader_class, uploader_context
end
@@ -10,10 +8,10 @@ class UploadService
def execute
return nil unless @file && @file.size <= max_attachment_size
- @uploader = @uploader_class.new(@model, nil, @uploader_context)
- @uploader.store!(@file)
+ uploader = @uploader_class.new(@model, nil, @uploader_context)
+ uploader.store!(@file)
- @uploader.to_h
+ uploader
end
private