I'm trying to work on a finite state machine with AASM in Ruby. This is a part of my code:
event :Orthography, :before => :to_lowercase do
puts "Check Orthography"
transitions :from => :Initialized, :to => :UniquenessChecked
end
event :Uniqueness do
puts "Check Uniqueness"
transitions :from => :UniquenessChecked, :to => :OrthographyChecked
end
...
def to_lowercase
puts "To lowercase test"
end
I get as puts log:
Check Orthography
Check Uniqueness
To lowercase test
But I expect, because I use the before callback:
To lowercase test
Check Orthography
Check Uniqueness
How can I do something before or on enter of a event?