Permalink
Browse files

Merge pull request #12085 from valk/master

FIX reload! within rails console --sandbox causes undefined method rollb...
  • Loading branch information...
1 parent 26eef6a commit 1c6556f750a665c367fd9844b690912bd7d4351f @spastorino spastorino committed Aug 30, 2013
Showing with 3 additions and 1 deletion.
  1. +3 −1 activerecord/lib/active_record/railties/console_sandbox.rb
View
4 activerecord/lib/active_record/railties/console_sandbox.rb
@@ -1,5 +1,7 @@
ActiveRecord::Base.connection.begin_transaction(joinable: false)
at_exit do
- ActiveRecord::Base.connection.rollback_transaction
+ if ActiveRecord::Base.connection.transaction_open?
+ ActiveRecord::Base.connection.rollback_transaction
+ end
end

0 comments on commit 1c6556f

Please sign in to comment.