Permalink
Browse files

Merge pull request #12085 from valk/master

FIX reload! within rails console --sandbox causes undefined method rollb...
  • Loading branch information...
2 parents ffa56f7 + b960000 commit 15455d76c8d33b3767a61e0cdd2de0ff592098ef @spastorino spastorino committed Aug 30, 2013
Showing with 3 additions and 1 deletion.
  1. +3 −1 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 15455d7

Please sign in to comment.