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:
parent
385bbe3727
commit
5dbacab578
1 changed files with 1 additions and 1 deletions
|
@ -58,7 +58,7 @@ module AASM
|
||||||
end
|
end
|
||||||
|
|
||||||
def state_object_for_name(name)
|
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?
|
raise AASM::UndefinedState, "State :#{name} doesn't exist" if obj.nil?
|
||||||
obj
|
obj
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue