I’m using an ActiveRecord::Observer to log users changing data in my
application. However, I’ve noted that adding an item to a has_many
relationship gets logged, but removing the item does not. That is:
@product.users << user
is logged, but:
I’ve dug into ActiveRecord and found that the underlying issue is that
the HasManyAssociation delete_records method uses update_all to update
the record. update_all bypasses the normal call backs and therefore also
bypasses the Observer.
Is there a way to get an Observer to observe update_all calls?