aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage
diff options
context:
space:
mode:
authorutilum <oz@utilum.com>2018-05-23 22:03:45 +0200
committerutilum <oz@utilum.com>2018-05-23 23:48:32 +0200
commitf6f8fc2ca00f624c2af9ef6d0dec07bc4cf4660e (patch)
tree8fcc2a33b5cf1489e66a15ddd7cf32bfe15dd590 /activestorage
parent4d43b05881265ee02cb4b7ab37d7e1fa49559184 (diff)
downloadrails-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.rb14
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