Showing posts with label activerecord. Show all posts
Showing posts with label activerecord. Show all posts

Monday, January 14, 2013

The not so famous before_remove/before_add & after_remove/after_add callbacks.

Well, this is another rails feature and a quite nice one which is not documented properly.

While using has_many :through associations, we can use before_remove, before_add, after_remove, after_add callbacks.

Thursday, December 20, 2012

Rails 2.3 after_create callback doesn't rollback even if returned false

So, this is another mind-boggling thing i came across yesterday. I am working on rails 2.3.11

So i had some after_create callbacks on my app's Order model.

The problem i faced was even when the callbacks would fail, the order was still created and the changes would't ROLLBACK!!