At the moment we have a few ActiveAdmin resources that perform actions after records are saved, e.g.
after_save do |user|
if user.last_name_changed? or user.name_prefix_changed?
user.update_forum_display_name
user.update_coat
end
end
But this is no good because ActiveAdmin has a bug where after_save is called even if the model isn't saved (say, because it's invalid). It's also probably not the right place for them anyway. They should probably be on the model's after_save hook or something.
Whilst we're at it, we can have the callback raise :abort if those third party API commands fail (when it makes sense to).
At the moment we have a few ActiveAdmin resources that perform actions after records are saved, e.g.
But this is no good because ActiveAdmin has a bug where
after_save
is called even if the model isn't saved (say, because it's invalid). It's also probably not the right place for them anyway. They should probably be on the model'safter_save
hook or something.Whilst we're at it, we can have the callback
raise :abort
if those third party API commands fail (when it makes sense to).