Sha256: 4db20424562801902b2a41bc8a8e14a62256c65387ff2cc8cd30f7cc629b1f2c
Contents?: true
Size: 701 Bytes
Versions: 14
Compression:
Stored size: 701 Bytes
Contents
module Pageflow class Page < ApplicationRecord include SerializedConfiguration include NestedRevisionComponent 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 end end
Version data entries
14 entries across 14 versions & 1 rubygems