diff options
-rw-r--r-- | activestorage/app/models/active_storage/variation.rb | 8 | ||||
-rw-r--r-- | railties/test/generators/app_generator_test.rb | 12 | ||||
-rw-r--r-- | railties/test/generators/shared_generator_tests.rb | 4 |
3 files changed, 16 insertions, 8 deletions
diff --git a/activestorage/app/models/active_storage/variation.rb b/activestorage/app/models/active_storage/variation.rb index 09997eb97f..2b599a4710 100644 --- a/activestorage/app/models/active_storage/variation.rb +++ b/activestorage/app/models/active_storage/variation.rb @@ -46,15 +46,15 @@ class ActiveStorage::Variation # Accepts an open MiniMagick image instance, like what's returned by <tt>MiniMagick::Image.read(io)</tt>, # and performs the +transformations+ against it. The transformed image instance is then returned. def transform(image) - transformations.each do |(method, argument)| - if method.to_s == "combine_options" + transformations.each do |(transformation_method, transformation_argument)| + if transformation_method.to_s == "combine_options" image.combine_options do |combination| - argument.each do |(method, argument)| + transformation_argument.each do |(method, argument)| pass_transform_argument(combination, method, argument) end end else - pass_transform_argument(image, method, argument) + pass_transform_argument(image, transformation_method, transformation_argument) end end end diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index 793cce2999..fcb515c606 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -324,7 +324,9 @@ class AppGeneratorTest < Rails::Generators::TestCase end generator.stub :rails_command, command_check do - quietly { generator.invoke_all } + generator.stub :bundle_command, nil do + quietly { generator.invoke_all } + end end end @@ -762,7 +764,9 @@ class AppGeneratorTest < Rails::Generators::TestCase end generator([destination_root], webpack: "webpack").stub(:rails_command, command_check) do - quietly { generator.invoke_all } + generator.stub :bundle_command, nil do + quietly { generator.invoke_all } + end end assert_gem "webpacker" @@ -783,7 +787,9 @@ class AppGeneratorTest < Rails::Generators::TestCase end generator([destination_root], webpack: "react").stub(:rails_command, command_check) do - quietly { generator.invoke_all } + generator.stub :bundle_command, nil do + quietly { generator.invoke_all } + end end end diff --git a/railties/test/generators/shared_generator_tests.rb b/railties/test/generators/shared_generator_tests.rb index 7a746f5b62..29528825b8 100644 --- a/railties/test/generators/shared_generator_tests.rb +++ b/railties/test/generators/shared_generator_tests.rb @@ -92,7 +92,9 @@ module SharedGeneratorTests end generator([destination_root], template: path).stub(:open, check_open, template) do - quietly { assert_match(/It works!/, capture(:stdout) { generator.invoke_all }) } + generator.stub :bundle_command, nil do + quietly { assert_match(/It works!/, capture(:stdout) { generator.invoke_all }) } + end end end |