Class: MultipleTableInheritance::Railtie

Inherits:
Rails::Railtie
  • Object
show all
Defined in:
lib/multiple_table_inheritance/railtie.rb,
lib/multiple_table_inheritance/railtie.rb

Class Method Summary collapse

Class Method Details

.insertObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/multiple_table_inheritance/railtie.rb', line 11

def self.insert
  ::ActiveRecord::Base.module_eval do
    include MultipleTableInheritance::Child::Base
    include MultipleTableInheritance::Parent::Base
  end
  
  ::ActiveRecord::Relation.module_eval do
    include MultipleTableInheritance::Parent::Relation
  end
  
  ::ActiveRecord::ConnectionAdapters::SchemaStatements.module_eval do
    include MultipleTableInheritance::Migration
  end
end