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

Fixed missing name method for state object

This commit is contained in:
Tsyren Ochirov 2015-09-07 14:07:45 +02:00
parent 385bbe3727
commit 5dbacab578

View file

@ -58,7 +58,7 @@ module AASM
end
def state_object_for_name(name)
obj = @instance.class.aasm.states.find {|s| s == name}
obj = @instance.class.aasm.states.find {|s| s.name == name}
raise AASM::UndefinedState, "State :#{name} doesn't exist" if obj.nil?
obj
end