diff options
-rw-r--r-- | railties/bin/console_sandbox.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/railties/bin/console_sandbox.rb b/railties/bin/console_sandbox.rb new file mode 100644 index 0000000000..80f3dbc223 --- /dev/null +++ b/railties/bin/console_sandbox.rb @@ -0,0 +1,6 @@ +ActiveRecord::Base.lock_mutex +ActiveRecord::Base.connection.begin_db_transaction +at_exit do + ActiveRecord::Base.connection.rollback_db_transaction + ActiveRecord::Base.unlock_mutex +end |