Sha256: 90f24e6670a2e9284c76abba6b453d2bde22805ffc7ab1a84a8d3efc1e51e0ba
Contents?: true
Size: 726 Bytes
Versions: 13
Compression:
Stored size: 726 Bytes
Contents
module Pageflow class Page < ApplicationRecord include SerializedConfiguration include AutoGeneratedPermaId belongs_to :chapter, touch: true attr_accessor :is_first validates_inclusion_of :template, :in => ->(_) { Pageflow.config.page_types.names } scope :displayed_in_navigation, -> { where(:display_in_navigation => true) } def title configuration['title'].presence || configuration['additional_title'] end def page_type Pageflow.config.page_types.find_by_name!(template) end def configuration=(value) self.display_in_navigation = value['display_in_navigation'] super end def copy_to(chapter) chapter.pages << dup end end end
Version data entries
13 entries across 13 versions & 1 rubygems