I am new to both Ruby and Rails.
I'm using AASM to put state machine behavior into a model class. Depending on the old and new states I want to handle the state change event in different ways.
How do I either invoke the "after" callback with the "to" and "from" states as arguments or access the internal fields of held by AASM if those have what I need? ...or do I just have to add both before and after callbacks and save the previous state in the before callback?
You can access ModelClass.aasm_state()
If you have different transitions for different states.
Aasm is pretty well documented. You can find the instructions in the README for aasm: https://github.com/rubyist/aasm