Module: MassiveRecord::ORM::SingleTableInheritance

Extended by:
ActiveSupport::Concern
Defined in:
lib/massive_record/orm/single_table_inheritance.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#ensure_proper_typeObject



40
41
42
43
44
45
46
# File 'lib/massive_record/orm/single_table_inheritance.rb', line 40

def ensure_proper_type
  inheritance_attribute = self.class.inheritance_attribute

  if respond_to?(inheritance_attribute) && self[inheritance_attribute].blank? && self.class.base_class != self.class
    self[inheritance_attribute] = self.class.to_s
  end
end