class ConstantRecord::Base

Base class to inherit from so we can share the same memory database

Public Class Methods

connection() click to toggle source

Reload table if connection changes. Since it's in-memory, a connection change means the the table gets wiped.

Calls superclass method
# File lib/constant_record.rb, line 224
def self.connection
  conn = super
  if (@previous_connection ||= conn) != conn
    @previous_connection = conn # avoid infinite loop
    reload_memory_table
  end
  conn
end