Module: MultiDb::ActiveRecordExtensions

Defined in:
lib/multi_db/active_record_extensions.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/multi_db/active_record_extensions.rb', line 3

def self.included(base)
  base.send :include, InstanceMethods
  base.send :extend, ClassMethods
  base.alias_method_chain :reload, :master
  base.cattr_accessor :connection_proxy
  # handle subclasses which were defined by the framework or plugins
  base.send(:subclasses).each do |child|
    child.hijack_connection
  end
end