From 7bdf3eacd23b64af4b954ed0fde001124e21769b Mon Sep 17 00:00:00 2001 From: Ahmed AbdelHalim <347712+a14m@users.noreply.github.com> Date: Wed, 2 Jan 2019 23:26:39 +0100 Subject: [PATCH] Update the attr_reader to match the convention --- lib/aasm/errors.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/aasm/errors.rb b/lib/aasm/errors.rb index 69506998..8e9c7443 100644 --- a/lib/aasm/errors.rb +++ b/lib/aasm/errors.rb @@ -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