module AxleAttributes module Model extend ActiveSupport::Concern included do unless include?(ElasticRecord::Model) include ElasticRecord::Model end include AxleAttributes::HasAttributes self.has_attribute_definition_class = '::AxleAttributes::ParentDefinition' add_core_axle_attributes! unless self.name.demodulize == 'Base' include AxleAttributes::Provided include AxleAttributes::Segmented include AxleAttributes::Serializations include AxleAttributes::Versioned include AxleAttributes::Validations end module ClassMethods def inherited(child) super child.add_core_axle_attributes! end def add_core_axle_attributes! has_attribute(:created_at, type: :time, index: true, editable: false) unless attributes['created_at'] has_attribute(:updated_at, type: :time, index: true, editable: false) unless attributes['updated_at'] has_attribute(:segment_id, type: :integer, index: true, editable: false) unless attributes['segment_id'] end end end end