Save 36% for Black Friday! Learn more

Ask A Question

Notifications

You’re not receiving notifications from this thread.

How do i wrap calls to update_attributes via transaction?

Arul asked in Rails

I have two models User/Car. User can have many Cars. How do i prevent updates to cars if my user object is invalid? Currently Rails does not wrap the attribute update(cars) in a same transaction as user.

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 86,946+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.