1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

FIX reload! within rails console --sandbox causes undefined method rollback upon exiting [https://github.com/rails/rails/issues/11834]

This commit is contained in:
Val Kotlarov Hoffman 2013-08-30 13:29:20 +03:00
parent f90aa722fa
commit b960000179

View file

@ -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