Module: ActiveRecord::View::Integration

Included in:
ActiveRecord::View
Defined in:
lib/activerecord/view/integration.rb,
lib/activerecord/view/integration/model_methods.rb,
lib/activerecord/view/integration/schema_methods.rb,
lib/activerecord/view/integration/command_recorder_methods.rb

Defined Under Namespace

Modules: CommandRecorderMethods, ModelMethods, SchemaMethods

Constant Summary collapse

AR_INCLUSIONS =
{
  'SchemaMethods' => 'ActiveRecord::ConnectionAdapters::AbstractAdapter',
  'CommandRecorderMethods' => 'ActiveRecord::Migration::CommandRecorder'
}
AR_EXTENSIONS =
{
  'ModelMethods' => 'ActiveRecord::Base'
}

Instance Method Summary collapse

Instance Method Details

#enable!Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/activerecord/view/integration.rb', line 13

def enable!
  AR_INCLUSIONS.each do |mod_name, target|
    target_klass = target.constantize
    mod = "ActiveRecord::View::Integration::#{mod_name}".constantize

    target_klass.include mod
  end

  AR_EXTENSIONS.each do |mod_name, target|
    target_klass = target.constantize
    mod = "ActiveRecord::View::Integration::#{mod_name}".constantize

    target_klass.extend mod
  end

  #ActiveRecord::ConnectionAdapters::AbstractAdapter.include ActiveRecord::View::Integration::SchemaMethods
  #ActiveRecord::Base.extend ActiveRecord::View::Integration::ModelMethods
  #ActiveRecord::Migration::CommandRecorder.include ActiveRecord::View::
end