Skip to content

Commit

Permalink
maybe we should real event objects instead of name strings only (so w…
Browse files Browse the repository at this point in the history
…e could ask events more questions)
  • Loading branch information
alto committed Feb 27, 2013
1 parent f5e666e commit 696aaae
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/aasm/instance_base.rb
Expand Up @@ -33,6 +33,7 @@ def human_state
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}
Expand Down

0 comments on commit 696aaae

Please sign in to comment.