app/models/tramway/page/page.rb in tramway-page-1.5.3.4 vs app/models/tramway/page/page.rb in tramway-page-1.5.3.6

- old
+ new

@@ -6,18 +6,18 @@ 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 + aasm :view_state, column: :view_state do + state :unpublished, initial: true state :published event :publish do - transition unpublished: :published + transitions from: :unpublished, to: :published end event :hide do - transition published: :unpublished + transitions from: :published, to: :unpublished end end end