Module: Traits::Attribute::Inheritance

Included in:
Traits::Attribute
Defined in:
lib/traits/attribute/inheritance.rb

Instance Method Summary collapse

Instance Method Details

#inheritance_type?Boolean Also known as: sti_type?

Returns:

  • (Boolean)


7
8
9
# File 'lib/traits/attribute/inheritance.rb', line 7

def inheritance_type?
  (model.inheritance_base? || model.inheritance_derived?) and name == model.inheritance_attribute.name
end

#to_hashObject



12
13
14
# File 'lib/traits/attribute/inheritance.rb', line 12

def to_hash
  super.merge!(is_sti_type: sti_type?)
end