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

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}