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:
commit
64a133407d
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue