Christos Zisopoulos
2008-May-06 11:00 UTC
Observers and notification order for associated records
Hi, Is it by design that the following happens, or is it an ActiveRecord bug (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. Has anyone come across this before? -christos --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---