Class: Pageflow::Chapter

Inherits:
ApplicationRecord show all
Includes:
AutoGeneratedPermaId, NestedRevisionComponent, SerializedConfiguration
Defined in:
app/models/pageflow/chapter.rb

Overview

rubocop:todo Style/Documentation

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from AutoGeneratedPermaId

#ensure_perma_id

Methods included from NestedRevisionComponent

#duplicate

Methods included from SerializedConfiguration

#configuration

Instance Attribute Details

#is_firstObject

Returns the value of attribute is_first.



12
13
14
# File 'app/models/pageflow/chapter.rb', line 12

def is_first
  @is_first
end

Instance Method Details

#entry_for_auto_generated_perma_idObject



20
21
22
# File 'app/models/pageflow/chapter.rb', line 20

def entry_for_auto_generated_perma_id
  storyline.revision.entry
end

#pagesObject



16
17
18
# File 'app/models/pageflow/chapter.rb', line 16

def pages
  super.tap { |p| p.first.is_first = true if is_first && p.present? }
end