aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2019-05-15 15:53:43 -0400
committerGeorge Claghorn <george@basecamp.com>2019-05-15 15:53:43 -0400
commit5f50f4d63b3a11a31ae2999053cdaf12134f84ee (patch)
tree59a97ad5292563f19dd0feaa3e3b086adbe57fbe /activestorage
parent13d6aa3a7b70bca66c4abda7721329ad1863c24c (diff)
downloadrails-5f50f4d63b3a11a31ae2999053cdaf12134f84ee.tar.gz
rails-5f50f4d63b3a11a31ae2999053cdaf12134f84ee.tar.bz2
rails-5f50f4d63b3a11a31ae2999053cdaf12134f84ee.zip
Inline anemic methods
Diffstat (limited to 'activestorage')
-rw-r--r--activestorage/app/models/active_storage/variant.rb14
1 files changed, 4 insertions, 10 deletions
diff --git a/activestorage/app/models/active_storage/variant.rb b/activestorage/app/models/active_storage/variant.rb
index bc0058967a..1859b8482e 100644
--- a/activestorage/app/models/active_storage/variant.rb
+++ b/activestorage/app/models/active_storage/variant.rb
@@ -96,19 +96,13 @@ class ActiveStorage::Variant
end
def process
- blob.open do |image|
- transform(image) { |output| upload(output) }
+ blob.open do |input|
+ variation.transform(input, format: format) do |output|
+ service.upload(key, output)
+ end
end
end
- def transform(image, &block)
- variation.transform(image, format: format, &block)
- end
-
- def upload(file)
- service.upload(key, file)
- end
-
def specification
@specification ||=