Hello, Is there a way to implement a callback for somehting like before_add and after_ad on a statement like this with a has_many relation? x.children << Item.create(:title=>"test") I want that x has a callback that is called when the item is added. I found something in C:\ruby\lib\ruby\gems\1.8\gems\activerecord-1.14.0\lib\active_record\associations\association_collection.rb but I can not override it. Any hints? Regards Till -- Posted via http://www.ruby-forum.com/.
Apparently Analagous Threads
- How to turn :before_add exceptions into validation errors
- enforce mutual exclusivity
- unable to get "has_many :after_add" to work - need help
- How can I overwrite the parent.children.push(child) Method?
- conditional boost? friends to come up at top of search...