Class: Pageflow::Page

Inherits:
ApplicationRecord show all
Includes:
AutoGeneratedPermaId, NestedRevisionComponent, SerializedConfiguration
Defined in:
app/models/pageflow/page.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.



9
10
11
# File 'app/models/pageflow/page.rb', line 9

def is_first
  @is_first
end

Instance Method Details

#configuration=(value) ⇒ Object



27
28
29
30
# File 'app/models/pageflow/page.rb', line 27

def configuration=(value)
  self.display_in_navigation = value['display_in_navigation']
  super
end

#entry_for_auto_generated_perma_idObject



15
16
17
# File 'app/models/pageflow/page.rb', line 15

def entry_for_auto_generated_perma_id
  chapter.storyline.revision.entry
end

#page_typeObject



23
24
25
# File 'app/models/pageflow/page.rb', line 23

def page_type
  Pageflow.config.page_types.find_by_name!(template)
end

#titleObject



19
20
21
# File 'app/models/pageflow/page.rb', line 19

def title
  configuration['title'].presence || configuration['additional_title']
end