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
1 changed files with 1 additions and 1 deletions

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