Take the 2008 Git User's Survey and help out! [ hide ]

public
Fork of wycats/merb-plugins
Description: Merb Plugins: Even more modules to hook up your Merb installation
Homepage: http://www.merbivore.com
Clone URL: git://github.com/auser/merb-plugins.git
Search Repo:
Implementation of IRB sandbox methods

To support the --sandbox option for the IRB console, open_sandbox! and 
close_sandbox! have been added (as module singleton methods).
fabien (author)
Wed Mar 12 13:31:23 -0700 2008
commit  f3ec2c50a0695f6d3a135d28a2a552feac0b5d32
tree    8a5c184b2eb810cc75fe8e90473d6cffe8d1c333
parent  4024820c9f4b1832c65ad4f605513ad0ae5ae012
...
4
5
6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
8
9
...
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
0
@@ -4,6 +4,23 @@ require 'active_record'
0
 module Merb
0
   module Orms
0
     module ActiveRecord
0
+
0
+ # Start a transaction.
0
+ #
0
+ # Used by Merb::Rack::Console#open_sandbox!
0
+ def self.open_sandbox!
0
+ ::ActiveRecord::Base.send :increment_open_transactions
0
+ ::ActiveRecord::Base.connection.begin_db_transaction
0
+ end
0
+
0
+ # Rollback a transaction.
0
+ #
0
+ # Used by Merb::Rack::Console#open_sandbox!
0
+ def self.close_sandbox!
0
+ ::ActiveRecord::Base.connection.rollback_db_transaction
0
+ ::ActiveRecord::Base.send :decrement_open_transactions
0
+ end
0
+
0
       class << self
0
         def config_file() Merb.dir_for(:config) / "database.yml" end
0
         def sample_dest() Merb.dir_for(:config) / "database.yml.sample" end

Comments

    No one has commented yet.