Permalink
Browse files

Replace ClosedTransaction with NullTransaction

  • Loading branch information...
1 parent 62c75f4 commit 057c23715434adcab9b12f987d615979d1f57549 @arthurnn arthurnn committed Jul 31, 2014
@@ -43,8 +43,8 @@ def savepoint_name
end
end
- class ClosedTransaction < Transaction #:nodoc:
- def initialize; super(nil); end
+ class NullTransaction < Transaction #:nodoc:
+ def initialize; end
def closed?; true; end
def open?; false; end
def joinable?; false; end
@@ -203,14 +203,11 @@ def open_transactions
end
def current_transaction
- @stack.last || closed_transaction
+ @stack.last || NULL_TRANSACTION
end
private
-
- def closed_transaction
- @closed_transaction ||= ClosedTransaction.new
- end
+ NULL_TRANSACTION = NullTransaction.new
end
end
end
@@ -46,7 +46,7 @@ module ConnectionAdapters # :nodoc:
autoload_at 'active_record/connection_adapters/abstract/transaction' do
autoload :TransactionManager
- autoload :ClosedTransaction
+ autoload :NullTransaction
autoload :RealTransaction
autoload :SavepointTransaction
autoload :TransactionState

0 comments on commit 057c237

Please sign in to comment.