[Rails] ActiveRecord callback chain exception?
I'm creating an ActiveRecord object A and want to update object B during
the process even if the creation of object A is rolled back due to a
before_create callback returning false.
Is there a way for me to do this?
It seems that once you're in the ActiveRecord callback chain your DB
updates will be rolled back unless the entire callback chain returns
true.
Another way to look at this: I need to track all ActiveRecord "create"
attempts but it seems that I'm unable to use callbacks or observers to
do this since both are referenced within the ActiveRecord callback
chain.
How would you go about doing this?
Thanks for the help!
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home