How do I make an aasm event return a value other than boolean? I'm using aasm 2.2.0
E.g. There is a MusicPlayer model which randomly plays a song when started
aasm_state :started, :after_enter => :play_song
aasm_state :stopped
aasm_event :start do
:transitions :from => :stopped, :to => :started
end
def play_song
# select and play a song randomly and return the song object
end
Now if I want to return the song that is currently being played on starting the player, how do I do it through the 'play_song' method?