Module: Traits::Attribute::Inheritance
- Included in:
- Traits::Attribute
- Defined in:
- lib/traits/attribute/inheritance.rb
Instance Method Summary collapse
- #inheritance_type? ⇒ Boolean (also: #sti_type?)
- #to_hash ⇒ Object
Instance Method Details
#inheritance_type? ⇒ Boolean Also known as: sti_type?
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_hash ⇒ Object
12 13 14 |
# File 'lib/traits/attribute/inheritance.rb', line 12 def to_hash super.merge!(is_sti_type: sti_type?) end |