diff options
author | George Claghorn <george.claghorn@gmail.com> | 2018-05-23 21:56:33 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-23 21:56:33 -0400 |
commit | 097650c194a80004169423c696974c504228c460 (patch) | |
tree | d0e5b36eee7df9b36d08bcb10e148484d0ef2859 | |
parent | 49df9043c63bb08c3ad26631221f842516be616c (diff) | |
parent | f6f8fc2ca00f624c2af9ef6d0dec07bc4cf4660e (diff) | |
download | rails-097650c194a80004169423c696974c504228c460.tar.gz rails-097650c194a80004169423c696974c504228c460.tar.bz2 rails-097650c194a80004169423c696974c504228c460.zip |
Merge pull request #32968 from utilum/shadowing_outer_variable
Avoid 2.6 warning: shadowing outer local variable - list
-rw-r--r-- | activestorage/app/models/active_storage/variation.rb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/activestorage/app/models/active_storage/variation.rb b/activestorage/app/models/active_storage/variation.rb index 806af6366d..ae1376a6cf 100644 --- a/activestorage/app/models/active_storage/variation.rb +++ b/activestorage/app/models/active_storage/variation.rb @@ -65,14 +65,12 @@ class ActiveStorage::Variation private # Applies image transformations using the ImageProcessing gem. def image_processing_transform(file, format) - operations = transformations.inject([]) do |list, (name, argument)| - list.tap do |list| - if name.to_s == "combine_options" - ActiveSupport::Deprecation.warn("The ImageProcessing ActiveStorage variant backend doesn't need :combine_options, as it already generates a single MiniMagick command. In Rails 6.1 :combine_options will not be supported anymore.") - list.concat argument.keep_if { |key, value| value.present? }.to_a - elsif argument.present? - list << [name, argument] - end + operations = transformations.each_with_object([]) do |(name, argument), list| + if name.to_s == "combine_options" + ActiveSupport::Deprecation.warn("The ImageProcessing ActiveStorage variant backend doesn't need :combine_options, as it already generates a single MiniMagick command. In Rails 6.1 :combine_options will not be supported anymore.") + list.concat argument.keep_if { |key, value| value.present? }.to_a + elsif argument.present? + list << [name, argument] end end |