Sha256: 5e7af99e6a042f70625fd6ccf3a2e7322f5685d78de24c5990148b5b88fbd674
Contents?: true
Size: 602 Bytes
Versions: 5
Compression:
Stored size: 602 Bytes
Contents
# frozen_string_literal: true class Tramway::Page::Page < ::Tramway::Core::ApplicationRecord has_many :blocks, -> { order(position: :asc) }, 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