diff options
author | utilum <oz@utilum.com> | 2018-05-23 22:03:45 +0200 |
---|---|---|
committer | utilum <oz@utilum.com> | 2018-05-23 23:48:32 +0200 |
commit | f6f8fc2ca00f624c2af9ef6d0dec07bc4cf4660e (patch) | |
tree | 8fcc2a33b5cf1489e66a15ddd7cf32bfe15dd590 /activestorage | |
parent | 4d43b05881265ee02cb4b7ab37d7e1fa49559184 (diff) | |
download | rails-f6f8fc2ca00f624c2af9ef6d0dec07bc4cf4660e.tar.gz rails-f6f8fc2ca00f624c2af9ef6d0dec07bc4cf4660e.tar.bz2 rails-f6f8fc2ca00f624c2af9ef6d0dec07bc4cf4660e.zip |
Avoid 2.6 warning: shadowing outer local variable - list
Diffstat (limited to 'activestorage')
-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 |