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:
David Heinemeier Hansson
2005-02-19 23:07:57 +00:00
parent b008b6f194
commit d7845d2919

View 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