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

Merge pull request #256 from Funfun/master

Fixed missing name method for state object
This commit is contained in:
Thorsten Böttger 2015-09-24 23:17:15 +12:00
commit 64a133407d

View file

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