Sha256: 574cda3c8a8d2078012395916aa443489dd752055f66590a90a0773bcf32a121

Contents?: true

Size: 632 Bytes

Versions: 14

Compression:

Stored size: 632 Bytes

Contents

module PageflowScrolled
  class Section < Pageflow::ApplicationRecord
    include Pageflow::SerializedConfiguration
    include Pageflow::AutoGeneratedPermaId
    include Pageflow::NestedRevisionComponent

    belongs_to :chapter
    has_many :content_elements,
             -> { order('pageflow_scrolled_content_elements.position ASC') },
             dependent: :destroy,
             inverse_of: :section

    nested_revision_components :content_elements

    def self.all_for_revision(revision)
      joins(chapter: {storyline: :revision})
        .where(pageflow_scrolled_storylines: {revision_id: revision})
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
pageflow-17.0.4 entry_types/scrolled/app/models/pageflow_scrolled/section.rb
pageflow-17.0.3 entry_types/scrolled/app/models/pageflow_scrolled/section.rb
pageflow-17.0.2 entry_types/scrolled/app/models/pageflow_scrolled/section.rb
pageflow-17.0.1 entry_types/scrolled/app/models/pageflow_scrolled/section.rb
pageflow-17.0.0 entry_types/scrolled/app/models/pageflow_scrolled/section.rb
pageflow-16.2.0 entry_types/scrolled/app/models/pageflow_scrolled/section.rb
pageflow-16.1.0 entry_types/scrolled/app/models/pageflow_scrolled/section.rb
pageflow-16.0.0 entry_types/scrolled/app/models/pageflow_scrolled/section.rb
pageflow-15.8.0 entry_types/scrolled/app/models/pageflow_scrolled/section.rb
pageflow-15.7.1 entry_types/scrolled/app/models/pageflow_scrolled/section.rb
pageflow-15.7.0 entry_types/scrolled/app/models/pageflow_scrolled/section.rb
pageflow-15.6.1 entry_types/scrolled/app/models/pageflow_scrolled/section.rb
pageflow-15.6.0 entry_types/scrolled/app/models/pageflow_scrolled/section.rb
pageflow-15.5.0 entry_types/scrolled/app/models/pageflow_scrolled/section.rb