Module: Trax::Model::Mixins::StiEnum

Extended by:
Trax::Model::Mixin
Defined in:
lib/trax/model/mixins/sti_enum.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Methods included from Trax::Model::Mixin

after_included, extended, mixed, mixed_in

Instance Method Details

#set_kind_from_typeObject



22
23
24
# File 'lib/trax/model/mixins/sti_enum.rb', line 22

def set_kind_from_type
  self[:kind] = self.class.type_to_kind_mapping[self[:type]] if self.has_attribute?(:kind) && self.has_attribute?(:type) && self.has_attribute?(:type) && !self[:kind]
end

#set_type_from_kindObject



18
19
20
# File 'lib/trax/model/mixins/sti_enum.rb', line 18

def set_type_from_kind
  self[:type] = self.class.kind_to_type_mapping[self[:kind]] if self.has_attribute?(:kind) && self.has_attribute?(:type) && !self[:type]
end