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:
parent
f90aa722fa
commit
b960000179
1 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue