Sha256: f4ca5bd39d10ec74318d4b3ea3afe85eb7bc2acd58951a1964da32900ec58362
Contents?: true
Size: 876 Bytes
Versions: 12
Compression:
Stored size: 876 Bytes
Contents
# A TransactionObject belongs to a connection. It's like a singleton for each transaction. # # Author:: Andre Kullmann # module ActiveRecord module Bulkoperation module Util class TransactionObject def self.get result = ActiveRecord::Base.connection.connection_listeners.select { |l| l.class == self }.first unless result result = new ActiveRecord::Base.connection.connection_listeners << result end result end def after_commit close ActiveRecord::Base.connection.connection_listeners.delete(self) end def after_rollback close ActiveRecord::Base.connection.connection_listeners.delete(self) end def after_rollback_to_savepoint end def close end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems