aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/active_storage
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2017-07-21 16:12:29 -0500
committerDavid Heinemeier Hansson <david@loudthinking.com>2017-07-21 16:12:29 -0500
commit796f8330ad441e93590a57521ef8fb80a030fb66 (patch)
treed69396c2ac693de55aebbdc5f1e3df01e69d1fc0 /app/controllers/active_storage
parent67606dcdf52ae7f83e42a9872fdc545b02f227a2 (diff)
downloadrails-796f8330ad441e93590a57521ef8fb80a030fb66.tar.gz
rails-796f8330ad441e93590a57521ef8fb80a030fb66.tar.bz2
rails-796f8330ad441e93590a57521ef8fb80a030fb66.zip
Fix and test VariantsController
Diffstat (limited to 'app/controllers/active_storage')
-rw-r--r--app/controllers/active_storage/variants_controller.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/controllers/active_storage/variants_controller.rb b/app/controllers/active_storage/variants_controller.rb
index 05685dca17..dde7e1458f 100644
--- a/app/controllers/active_storage/variants_controller.rb
+++ b/app/controllers/active_storage/variants_controller.rb
@@ -13,7 +13,10 @@ class ActiveStorage::VariantsController < ActionController::Base
end
def processed_variant_for(blob_key)
- ActiveStorage::Variant.find_or_process_by!(blob_key: blob_key, encoded_variant_key: params[:encoded_variant_key])
+ ActiveStorage::Variant.new(
+ ActiveStorage::Blob.find_by!(key: blob_key),
+ ActiveStorage::Variation.decode(params[:variation_key])
+ ).processed
end
def disposition_param