Sha256: 372f95b238e0571fb37aa3f33891cc85d02678d4d37c79588e6b251f1e89ac55

Contents?: true

Size: 469 Bytes

Versions: 7

Compression:

Stored size: 469 Bytes

Contents

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
    state :done
    state :declined

    event :do do
      transition must_be_done: :done
    end

    event :decline do
      transition must_be_done: :declined
    end

    event :return do
      transition [ :declined, :done ] => :must_be_done
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
tramway-event-1.11.0.1 app/models/tramway/event/action.rb
tramway-event-1.11 app/models/tramway/event/action.rb
tramway-event-1.10.2 app/models/tramway/event/action.rb
tramway-event-1.10.1 app/models/tramway/event/action.rb
tramway-event-1.10.0.2 app/models/tramway/event/action.rb
tramway-event-1.10.0.1 app/models/tramway/event/action.rb
tramway-event-1.10 app/models/tramway/event/action.rb