Class: Pageflow::Page

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from AutoGeneratedPermaId

#ensure_perma_id

Methods included from SerializedConfiguration

#configuration

Instance Attribute Details

#is_firstObject

Returns the value of attribute is_first.



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

def is_first
  @is_first
end

Instance Method Details

#configuration=(value) ⇒ Object



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

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

#copy_to(chapter) ⇒ Object



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

def copy_to(chapter)
  chapter.pages << dup
end

#page_typeObject



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

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

#titleObject



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

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