Sha256: a92487f67f108f952fe07529abe5ab6c4539ce48418bd55bf059d0c0a793ab42

Contents?: true

Size: 578 Bytes

Versions: 41

Compression:

Stored size: 578 Bytes

Contents

module Pageflow
  class Storyline < ApplicationRecord
    include SerializedConfiguration
    include RevisionComponent

    belongs_to :revision, touch: true

    has_many(:chapters,
             -> { order('pageflow_chapters.position ASC') },
             dependent: :destroy,
             inverse_of: :storyline)

    has_many :pages, through: :chapters

    delegate :entry, to: :revision

    def copy_to(revision)
      storyline = dup
      revision.storylines << storyline

      chapters.each do |chapter|
        chapter.copy_to(storyline)
      end
    end
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
pageflow-14.5.2 app/models/pageflow/storyline.rb
pageflow-15.1.0.beta2 app/models/pageflow/storyline.rb
pageflow-15.1.0.beta1 app/models/pageflow/storyline.rb
pageflow-15.0.2 app/models/pageflow/storyline.rb
pageflow-15.0.1 app/models/pageflow/storyline.rb
pageflow-15.0.0 app/models/pageflow/storyline.rb
pageflow-14.5.1 app/models/pageflow/storyline.rb
pageflow-14.5.0 app/models/pageflow/storyline.rb
pageflow-15.0.0.rc2 app/models/pageflow/storyline.rb
pageflow-15.0.0.rc1 app/models/pageflow/storyline.rb
pageflow-15.0.0.beta4 app/models/pageflow/storyline.rb
pageflow-15.0.0.beta3 app/models/pageflow/storyline.rb
pageflow-14.4.0 app/models/pageflow/storyline.rb
pageflow-15.0.0.beta2 app/models/pageflow/storyline.rb
pageflow-15.0.0.beta1 app/models/pageflow/storyline.rb
pageflow-14.3.0 app/models/pageflow/storyline.rb
pageflow-14.2.1 app/models/pageflow/storyline.rb
pageflow-14.2.0 app/models/pageflow/storyline.rb
pageflow-14.1.1 app/models/pageflow/storyline.rb
pageflow-14.1.0 app/models/pageflow/storyline.rb