[I asked this in rails-talk a few days ago, but I didn't get an answer. Thinking that the question might be a bit more esoteric, and more appropriate to ask in Core. Apologies if I am off-topic]
Is it by design that the following happens (Rails 2.0.2)?
@post = Post.find(params[:id]) @post.comments.build(params[:comment]) @post.save
Assuming I have a PostObserver which observes after_update, what happens is:
1. Transaction BEGINS 2. @post is saved 3. PostObserver#after_update is called 4. Comment is created 5. Transaction COMMITED
As this is a transaction I would expect to get the after_update, AFTER all associated records are created/updated but this is not the case.
-christos