Sha256: 686af728f238c0b7aaf0c2889081431dfb6b8e8133fbb9e6f4fe48d7ceaa4ee4

Contents?: true

Size: 497 Bytes

Versions: 26

Compression:

Stored size: 497 Bytes

Contents

# 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
    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 %i[declined done] => :must_be_done
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
tramway-event-1.12.6 app/models/tramway/event/action.rb
tramway-event-1.12.5 app/models/tramway/event/action.rb
tramway-event-1.12.4 app/models/tramway/event/action.rb
tramway-event-1.12.3.10 app/models/tramway/event/action.rb
tramway-event-1.12.3.9 app/models/tramway/event/action.rb
tramway-event-1.12.3.8 app/models/tramway/event/action.rb
tramway-event-1.12.3.7 app/models/tramway/event/action.rb
tramway-event-1.12.3.6 app/models/tramway/event/action.rb
tramway-event-1.12.3.5 app/models/tramway/event/action.rb
tramway-event-1.12.3.4 app/models/tramway/event/action.rb
tramway-event-1.12.3.3 app/models/tramway/event/action.rb
tramway-event-1.12.3.2 app/models/tramway/event/action.rb
tramway-event-1.12.3.1 app/models/tramway/event/action.rb
tramway-event-1.12.3 app/models/tramway/event/action.rb
tramway-event-1.12.2 app/models/tramway/event/action.rb
tramway-event-1.12.1.1 app/models/tramway/event/action.rb
tramway-event-1.12.1 app/models/tramway/event/action.rb
tramway-event-1.12.0.1 app/models/tramway/event/action.rb
tramway-event-1.12 app/models/tramway/event/action.rb
tramway-event-1.11.5.1 app/models/tramway/event/action.rb