Created
December 11, 2017 21:41
-
-
Save pragtobgists/70fb6eb60eaf4f421b4088ca5ac2b0b2 to your computer and use it in GitHub Desktop.
nested transactions requires_new api.rubyonrails.org/classes/ActiveRecord/Transactions/ClassMethods.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| User.transaction do | |
| User.create(name: 'Kotori') | |
| User.transaction(requires_new: true) do | |
| User.create(name: 'Nemu') | |
| raise ActiveRecord::Rollback | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment