Sha256: e78ee98c11dbc115463c2c292675265c06281f67e8103ede329f8372cd826fee

Contents?: true

Size: 500 Bytes

Versions: 26

Compression:

Stored size: 500 Bytes

Contents

module Locomotive
  module Concerns
    module Page
      module EditableElements

        extend ActiveSupport::Concern

        included do
          embeds_many   :editable_elements, class_name: 'Locomotive::EditableElement', cascade_callbacks: true

          accepts_nested_attributes_for :editable_elements
        end

        def find_editable_element(block, slug)
          self.editable_elements.detect { |el| el.block == block && el.slug == slug }
        end

      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
locomotivecms-4.0.0.alpha3 app/models/locomotive/concerns/page/editable_elements.rb
locomotivecms-3.4.1 app/models/locomotive/concerns/page/editable_elements.rb
locomotivecms-4.0.0.alpha2 app/models/locomotive/concerns/page/editable_elements.rb
locomotivecms-4.0.0.alpha1 app/models/locomotive/concerns/page/editable_elements.rb
locomotivecms-3.4.0 app/models/locomotive/concerns/page/editable_elements.rb
locomotivecms-3.3.0 app/models/locomotive/concerns/page/editable_elements.rb
locomotivecms-3.3.0.rc3 app/models/locomotive/concerns/page/editable_elements.rb
locomotivecms-3.3.0.rc2 app/models/locomotive/concerns/page/editable_elements.rb
locomotivecms-3.1.2 app/models/locomotive/concerns/page/editable_elements.rb
locomotivecms-3.2.1 app/models/locomotive/concerns/page/editable_elements.rb
locomotivecms-3.3.0.rc1 app/models/locomotive/concerns/page/editable_elements.rb
locomotivecms-3.2.0 app/models/locomotive/concerns/page/editable_elements.rb
locomotivecms-3.2.0.rc2 app/models/locomotive/concerns/page/editable_elements.rb
locomotivecms-3.2.0.rc1 app/models/locomotive/concerns/page/editable_elements.rb
locomotivecms-3.1.1 app/models/locomotive/concerns/page/editable_elements.rb
locomotivecms-3.1.0 app/models/locomotive/concerns/page/editable_elements.rb
locomotivecms-3.1.0.rc3 app/models/locomotive/concerns/page/editable_elements.rb
locomotivecms-3.1.0.rc2 app/models/locomotive/concerns/page/editable_elements.rb
locomotivecms-3.1.0.rc1 app/models/locomotive/concerns/page/editable_elements.rb
locomotivecms-3.0.1 app/models/locomotive/concerns/page/editable_elements.rb