Sha256: ab5b39cd06ff55c68531ded2094f746d57f764fa8e2000d2b4ddddc5db03de77
Contents?: true
Size: 572 Bytes
Versions: 5
Compression:
Stored size: 572 Bytes
Contents
# frozen_string_literal: true class Tramway::Page::Page < ::Tramway::Core::ApplicationRecord has_many :blocks, class_name: 'Tramway::Landing::Block' enumerize :page_type, in: %i[main other], default: :other scope :landings, -> { where page_type: :landing } scope :published, -> { where view_state: :published } state_machine :view_state, initial: :unpublished do state :unpublished state :published event :publish do transition unpublished: :published end event :hide do transition published: :unpublished end end end
Version data entries
5 entries across 5 versions & 1 rubygems