There is no way provided by AASM to do this, but your own answer is getting already close enough to where you want to go. AASM is built around the assumption, that state machines allow multiple different transitions from one state to another.
If the event name is not relevant for you, you could reuse the to-state name as event name, like this:
aasm do
...
event :approved do
transitions :from => :submitted, :to => :approved
end
...
end
By this you can fire the event by just knowing the to-state name
approval_request.send(to_state)
By default, AASM raises an exception if this transition is not allowed. If you don't like the exception, set whiny_transitions
to false
, like this:
aasm :whiny_transitions => false do
...
end