Attacher.promote method will “abort” for two reasons:
- the attachment has changed on the original record
- the record was deleted
In Shrine 2.x it will unfortunately just return
nil, not giving you an option to handle the scenario. I’ve eventually realized the shortcomings of this, so in Shrine 3.x I’ve rewritten the
backgrounding plugin, and there exceptions will be raised for both cases (
ActiveRecord::RecordNotFound). In general, the new
backgrounding API is much more explicit, so you’ll have more control.
I’ve recently released
3.0.0.rc, and I’m encouraging people to try it out. Lots of things changed since 2.19, namely several plugins have been removed/deprecated, and
backgrounding have been rewritten. But in general there are big improvements in design and flexibility, and I’ve written detailed release notes and upgrading guide that should hopefully ease the transition.