提交 b9600001 编写于 作者: V Val Kotlarov Hoffman

FIX reload! within rails console --sandbox causes undefined method rollback...

FIX reload! within rails console --sandbox causes undefined method rollback upon exiting [https://github.com/rails/rails/issues/11834]
上级 f90aa722
ActiveRecord::Base.connection.begin_transaction(joinable: false)
at_exit do
if ActiveRecord::Base.connection.transaction_open?
ActiveRecord::Base.connection.rollback_transaction
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册