Hi,

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:

  @product.users.delete(user)

is not.

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?
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to