Sha256: 6d2dd1f5a25435f8d36c17b31c53e2cee3830328cb825a309249974597aa5f06
Contents?: true
Size: 514 Bytes
Versions: 12
Compression:
Stored size: 514 Bytes
Contents
# A ConnectionObject belongs to a connection. It's like a singleton for each connection. # # Author:: Andre Kullmann # class ConnectionObject 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 before_close close ActiveRecord::Base.connection.connection_listeners.delete(self) end def close end end
Version data entries
12 entries across 12 versions & 1 rubygems