Skip to content

Commit

Permalink
Fix missing block when using valid? method
Browse files Browse the repository at this point in the history
  • Loading branch information
kukicola committed Oct 25, 2022
1 parent ed8efba commit 3204469
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/active_storage_validations/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def read_image


raise InvalidImageError unless valid_image?(image)
yield image
yield image if block_given?
rescue LoadError, NameError
logger.info "Skipping image analysis because the mini_magick or ruby-vips gem isn't installed"
{}
Expand Down
1 change: 1 addition & 0 deletions test/active_storage_validations_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ class ActiveStorageValidations::Test < ActiveSupport::TestCase
e = OnlyImage.new
e.image.attach(image_1920x1080_file)
e.proc_image.attach(image_1920x1080_file)
e.another_image.attach(image_1920x1080_file)
assert e.valid?

e = OnlyImage.new
Expand Down

0 comments on commit 3204469

Please sign in to comment.