public
Rubygem
Description: RSpec extension library for Ruby on Rails
Homepage:
Clone URL: git://github.com/dchelimsky/rspec-rails.git
and now, without breaking stories against all the non-edge versions of rails
David Chelimsky (author)
Thu Jul 17 21:46:47 -0700 2008
commit  036020d0a4bc62233bc999cdc6dd040a3e68f355
tree    e605f533a9dad0246ef3b09f1e966ea56f75bc31
parent  96e2389b6162bf3ab87d78d06615f61a2778491f
...
40
41
42
43
 
 
 
44
45
46
47
48
49
 
50
51
52
53
54
55
 
 
 
56
57
58
59
60
61
...
40
41
42
 
43
44
45
46
 
 
47
 
48
49
50
51
52
53
54
 
55
56
57
58
 
 
59
60
61
0
@@ -40,22 +40,22 @@ class ActiveRecordSafetyListener
0
   include Singleton
0
   def scenario_started(*args)
0
     if defined?(ActiveRecord::Base)
0
-      if ActiveRecord::Base.respond_to?(:increment_open_transactions)
0
+      if ActiveRecord::Base.connection.respond_to?(:increment_open_transactions)
0
+        ActiveRecord::Base.connection.increment_open_transactions
0
+      else
0
         ActiveRecord::Base.send :increment_open_transactions
0
-      elsif ActiveRecord::Base.connection.respond_to?(:increment_open_transactions)
0
-        ActiveRecord::Base.connection.send :increment_open_transactions
0
       end
0
-      ActiveRecord::Base.connection.begin_db_transaction
0
     end
0
+    ActiveRecord::Base.connection.begin_db_transaction
0
   end
0
 
0
   def scenario_succeeded(*args)
0
     if defined?(ActiveRecord::Base)
0
       ActiveRecord::Base.connection.rollback_db_transaction
0
-      if ActiveRecord::Base.respond_to?(:decrement_open_transactions)
0
+      if ActiveRecord::Base.connection.respond_to?(:decrement_open_transactions)
0
+        ActiveRecord::Base.connection.decrement_open_transactions
0
+      else
0
         ActiveRecord::Base.send :decrement_open_transactions
0
-      elsif ActiveRecord::Base.connection.respond_to?(:decrement_open_transactions)
0
-        ActiveRecord::Base.connection.send :decrement_open_transactions
0
       end
0
     end
0
   end

Comments