In the Active Records Verification and Callbacks Guide :
If any callback method returns exactly false or throws an exception, the execution chain stops and returns ROLLBACK [...]
Thus, you can either eliminate the appearance of bubbles in ActiveRecord, or trap it yourself, transfer it to something that makes sense in the context of your application, and return false . You can log errors inside the before_save , so something like this might make sense:
before_save :do_magick_things private def do_magick_things
If you can translate ImageMagick errors into something that makes sense to the end user, then do_magick_things and translating the ImageMagick exception (as in do_magick_things ) is likely to make the most sense; Converting an exception to an error message also allows the caller to use save! if they want exceptions or save if they do not.
source share