Module: MultipleTableInheritance::Parent::Base::ClassMethods

Defined in:
lib/multiple_table_inheritance/parent/base.rb

Instance Method Summary collapse

Instance Method Details

#acts_as_superclass(options = {}) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/multiple_table_inheritance/parent/base.rb', line 16

def acts_as_superclass(options={})
  options = Base::default_options.merge(options.to_options)
  self.subtype_column = options[:subtype]
  
  if column_names.include?(subtype_column.to_s)
    include InstanceMethods
    before_destroy :destroy_child_association
  end
end