1
0
Fork 0
mirror of https://github.com/aasm/aasm synced 2023-03-27 23:22:41 -04:00

Update the attr_reader to match the convention

This commit is contained in:
Ahmed AbdelHalim 2019-01-02 23:26:39 +01:00 committed by Anil Kumar Maurya
parent cfb5479a8d
commit 7bdf3eacd2

View file

@ -3,11 +3,11 @@ module AASM
class UnknownStateMachineError < RuntimeError; end
class InvalidTransition < RuntimeError
attr_reader :object, :event_name, :originating_state, :failures, :state_machine
attr_reader :object, :event_name, :originating_state, :failures, :state_machine_name
def initialize(object, event_name, state_machine_name, failures = [])
@object, @event_name, @originating_state, @failures = object, event_name, object.aasm(state_machine_name).current_state, failures
@state_machine = state_machine_name
@state_machine_name = state_machine_name
super("Event '#{event_name}' cannot transition from '#{originating_state}'.#{reasoning}")
end