app/models/tramway/landing/block.rb in tramway-landing-3.2 vs app/models/tramway/landing/block.rb in tramway-landing-3.2.0.2
- old
+ new
@@ -8,19 +8,19 @@
enumerize :navbar_link, in: %i[exist not_exist], default: :not_exist
enumerize :link_object_type, in: ['Tramway::SportSchool::Document', 'Tramway::Page::Page']
uploader :background, :photo, extensions: %i[jpg jpeg gif png]
- state_machine :view_state, initial: :published do
- state :published
+ aasm :view_state do
+ state :published, initial: true
state :hidden
event :publish do
- transition hidden: :published
+ transitions from: :hidden, to: :published
end
event :hide do
- transition published: :hidden
+ transitions from: :published, to: :hidden
end
end
store_accessor :button, :button_link
store_accessor :button, :button_title