Sha256: 31570c4dce90bc26bd67d15980dd1d42b7754f270e6dcaeb35cb2ea68beee4d8

Contents?: true

Size: 529 Bytes

Versions: 3

Compression:

Stored size: 529 Bytes

Contents

# frozen_string_literal: true

class Tramway::Event::Action < Tramway::ApplicationRecord
  belongs_to :event, class_name: 'Tramway::Event::Event'

  aasm :action_state, column: :action_state do
    state :must_be_done, initial: true
    state :done
    state :declined

    event :do do
      transitions from: :must_be_done, to: :done
    end

    event :decline do
      transitions from: :must_be_done, to: :declined
    end

    event :return do
      transitions from: %i[declined done], to: :must_be_done
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tramway-event-2.0.1 app/models/tramway/event/action.rb
tramway-event-2.0.0.1 app/models/tramway/event/action.rb
tramway-event-2.0 app/models/tramway/event/action.rb