Sha256: 82a970961de4d70794b36455b0f12c1a8967686b07d6454d817f6d2b6817e78e
Contents?: true
Size: 469 Bytes
Versions: 14
Compression:
Stored size: 469 Bytes
Contents
module Pageflow class Chapter < ApplicationRecord include SerializedConfiguration include NestedRevisionComponent belongs_to :storyline, touch: true has_many :pages, -> { order('position ASC') }, dependent: :destroy, inverse_of: :chapter nested_revision_components :pages attr_accessor :is_first delegate :entry, to: :storyline def pages super.tap { |p| p.first.is_first = true if is_first && p.present? } end end end
Version data entries
14 entries across 14 versions & 1 rubygems