Class: Pageflow::Chapter
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Pageflow::Chapter
- Includes:
- SerializedConfiguration
- Defined in:
- app/models/pageflow/chapter.rb
Instance Attribute Summary collapse
-
#is_first ⇒ Object
Returns the value of attribute is_first.
Instance Method Summary collapse
Methods included from SerializedConfiguration
Instance Attribute Details
#is_first ⇒ Object
Returns the value of attribute is_first.
8 9 10 |
# File 'app/models/pageflow/chapter.rb', line 8 def is_first @is_first end |
Instance Method Details
#copy_to(storyline) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'app/models/pageflow/chapter.rb', line 16 def copy_to(storyline) chapter = dup storyline.chapters << chapter pages.each do |page| page.copy_to(chapter) end end |
#pages ⇒ Object
12 13 14 |
# File 'app/models/pageflow/chapter.rb', line 12 def pages super.tap { |p| p.first.is_first = true if is_first && p.present? } end |