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

maybe we should real event objects instead of name strings only (so we could ask events more questions)

This commit is contained in:
Thorsten Böttger 2013-02-27 14:34:42 +13:00
parent f5e666ef5f
commit 696aaae097

View file

@ -33,6 +33,7 @@ module AASM
end
# QUESTION: shouldn't events and permissible_events be the same thing?
# QUESTION: shouldn't events return objects instead of strings?
def events(state=current_state)
events = @instance.class.aasm.events.values.select {|e| e.transitions_from_state?(state) }
events.map {|e| e.name}