Sha256: 81bf8a251561ece8858e874831d8e7968cb4e8602c52283df4bec6e9411e4af7

Contents?: true

Size: 659 Bytes

Versions: 20

Compression:

Stored size: 659 Bytes

Contents

require 'active_support/concern'

module Model::Ecm::Cms::NavigationItem
  module PropertiesConcern
    extend ActiveSupport::Concern

    included do
      serialize :properties, OpenStruct
      delegate *Ecm::Cms::Configuration.navigation_item_properties, to: :li_attributes
      delegate *Ecm::Cms::Configuration.navigation_item_properties.collect { |a| "#{a}=".to_sym }, to: :li_attributes
    end

    def highlights_on
      properties.highlights_on ||= nil
    end

    delegate :highlights_on=, to: :properties

    def li_attributes
      properties.li_attributes ||= OpenStruct.new
    end

    delegate :li_attributes=, to: :properties
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
ecm_cms2-5.1.2 app/models/concerns/model/ecm/cms/navigation_item/properties_concern.rb
ecm_cms2-5.1.1 app/models/concerns/model/ecm/cms/navigation_item/properties_concern.rb
ecm_cms2-5.1.0 app/models/concerns/model/ecm/cms/navigation_item/properties_concern.rb
ecm_cms2-5.0.0 app/models/concerns/model/ecm/cms/navigation_item/properties_concern.rb
ecm_cms2-4.1.1 app/models/concerns/model/ecm/cms/navigation_item/properties_concern.rb
ecm_cms2-4.1.0 app/models/concerns/model/ecm/cms/navigation_item/properties_concern.rb
ecm_cms2-4.0.1 app/models/concerns/model/ecm/cms/navigation_item/properties_concern.rb
ecm_cms2-4.0.0 app/models/concerns/model/ecm/cms/navigation_item/properties_concern.rb
ecm_cms2-3.0.3 app/models/concerns/model/ecm/cms/navigation_item/properties_concern.rb
ecm_cms2-3.0.2 app/models/concerns/model/ecm/cms/navigation_item/properties_concern.rb
ecm_cms2-3.0.1 app/models/concerns/model/ecm/cms/navigation_item/properties_concern.rb
ecm_cms2-3.0.0 app/models/concerns/model/ecm/cms/navigation_item/properties_concern.rb
ecm_cms2-2.1.4 app/models/concerns/model/ecm/cms/navigation_item/properties_concern.rb
ecm_cms2-2.1.3 app/models/concerns/model/ecm/cms/navigation_item/properties_concern.rb
ecm_cms2-2.1.2 app/models/concerns/model/ecm/cms/navigation_item/properties_concern.rb
ecm_cms2-2.1.1 app/models/concerns/model/ecm/cms/navigation_item/properties_concern.rb
ecm_cms2-2.1.0 app/models/concerns/model/ecm/cms/navigation_item/properties_concern.rb
ecm_cms2-2.0.4 app/models/concerns/model/ecm/cms/navigation_item/properties_concern.rb
ecm_cms2-2.0.3 app/models/concerns/model/ecm/cms/navigation_item/properties_concern.rb
ecm_cms2-2.0.2 app/models/concerns/model/ecm/cms/navigation_item/properties_concern.rb