Created
December 8, 2010 20:19
-
-
Save evtuhovich/733842 to your computer and use it in GitHub Desktop.
Rails 2.3.x nested transaction rollback
This file contains 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
# File 1.rb, use rails 2.3.10 | |
require 'config/environment' | |
puts Message.count | |
Message.transaction do | |
Message.create! :author => 'test', :text => 'test' | |
Message.transaction do | |
Message.create! :author => 'test', :text => 'test' | |
raise ActiveRecord::Rollback | |
end | |
end | |
puts Message.count | |
$ ruby 1.rb | |
0 | |
2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment