app/models/tramway/event/action.rb in tramway-event-1.12.6 vs app/models/tramway/event/action.rb in tramway-event-1.12.6.2

- old
+ new

@@ -1,23 +1,23 @@ # frozen_string_literal: true class Tramway::Event::Action < Tramway::Core::ApplicationRecord belongs_to :event, class_name: 'Tramway::Event::Event' - state_machine :action_state, initial: :must_be_done do - state :must_be_done + aasm :action_state, column: :action_state do + state :must_be_done, initial: true state :done state :declined event :do do - transition must_be_done: :done + transitions from: :must_be_done, to: :done end event :decline do - transition must_be_done: :declined + transitions from: :must_be_done, to: :declined end event :return do - transition %i[declined done] => :must_be_done + transitions from: %i[declined done], to: :must_be_done end end end