Module: MultiConfig::ORMs::ActiveRecord

Defined in:
lib/multi_config/orms/active_record.rb

Overview

Implementation for the ActiveRecord ORM

Defined Under Namespace

Modules: ClassMethods, Config

Class Method Summary collapse

Class Method Details

.included(mod) ⇒ Object

Method called when the module is included.

  • mod - Name of the class including this module.

Calls mod.extend with param ClassMethods so that methods in ClassMethods module become class methods of the class.



9
10
11
12
13
# File 'lib/multi_config/orms/active_record.rb', line 9

def self.included(mod)
  mod.extend ClassMethods
  # Setting @@_multi_config_db_configs in the including class. This will help us keep track of database configuration files already included
  mod.send(:class_variable_set, :'@@_multi_config_db_configs', Hash.new { |h, k| h[k] = [] })
end