diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2013-08-30 10:44:25 -0700 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2013-08-30 10:44:25 -0700 |
commit | 15455d76c8d33b3767a61e0cdd2de0ff592098ef (patch) | |
tree | eb6a99749630a2d4b0459b18118e231a4b9da04e | |
parent | ffa56f73d5ae98fe0b8b6dd2ca6f0dffac9d9217 (diff) | |
parent | b9600001794eb1d4601f5774b592a068b73fd7b5 (diff) | |
download | rails-15455d76c8d33b3767a61e0cdd2de0ff592098ef.tar.gz rails-15455d76c8d33b3767a61e0cdd2de0ff592098ef.tar.bz2 rails-15455d76c8d33b3767a61e0cdd2de0ff592098ef.zip |
Merge pull request #12085 from valk/master
FIX reload! within rails console --sandbox causes undefined method rollb...
-rw-r--r-- | activerecord/lib/active_record/railties/console_sandbox.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/railties/console_sandbox.rb b/activerecord/lib/active_record/railties/console_sandbox.rb index 604a220303..1a04950898 100644 --- a/activerecord/lib/active_record/railties/console_sandbox.rb +++ b/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 |