I've just encountered a strange bug in an app where a newly created model was 
not visible in the database to a process was kicked off by an observer.

Looking through the logs and then the rails source, it looks like Observer 
methods are now getting fired as standard AR callbacks, meaning they fire in 
the AR transaction. 

This wasn't the case in 2.3 as far as I can tell. 

In my mind, observer callbacks should not be fired inside the AR transaction to 
avoid race conditions when observers kick of processes that try and access the 
new model before all the callbacks have completed and the transaction is 
committed.

Any thoughts?
 

Tekin Suleyman
http://tekin.co.uk

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" 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-core?hl=en.

Reply via email to