mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Added --sandbox option to script/console that'll roll back all changes made to the database when you quit #672 [bitsweat]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@701 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
6
railties/bin/console_sandbox.rb
Normal file
6
railties/bin/console_sandbox.rb
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user