Sha256: 90371b8990df00d31cd523489cb35574836f2c805831b5c01f5fb9794bbb56ed

Contents?: true

Size: 513 Bytes

Versions: 7

Compression:

Stored size: 513 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
    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

7 entries across 7 versions & 1 rubygems

Version Path
pageflow-12.6.0 app/models/pageflow/storyline.rb
pageflow-12.5.0 app/models/pageflow/storyline.rb
pageflow-12.4.1 app/models/pageflow/storyline.rb
pageflow-12.4.0 app/models/pageflow/storyline.rb
pageflow-12.3.0 app/models/pageflow/storyline.rb
pageflow-12.2.0 app/models/pageflow/storyline.rb
pageflow-12.1.0 app/models/pageflow/storyline.rb