title: AASM: proper syntax for a guard callback
body: <p>Here is my example code:</p>
  
  <pre><code>class Foo &lt; ActiveRecord::Base
    include AASM
    aasm_column :status
    aasm_initial_state :start_state
  
    aasm_state :start_state
    aasm_state :state_two
    aasm_state :end_state
  
    aasm_event :move_to_two, :guard =&gt; :guard_callback, :after =&gt; :after_callback do
      transitions :from =&gt; :start_state, :to =&gt; :state_two
    end
  
    def guard_callback
      puts "executing guard callback..."
      false
    end
  
    def after_callback
      puts "executing after callback..."
    end
  </code></pre>
  
  <p>This is a toy representation of what my code looks like. I'm only returning false from the guard callback to test the behavior of NOT executing the transition or the after. Here is the code I call in my test</p>
  
  <pre><code>foo = Foo.new
  foo.move_to_two!
  puts "foo's current status: #{foo.status}"
  </code></pre>
  
  <p>Here's the output</p>
  
  <pre><code>executing after callback...
  foo's current status: state_two
  </code></pre>
  
  <p>Notice that the guard never gets called...</p>
  
  <p>Am I putting the guard in the wrong place? Am I mistaken that returning false will halt the transition? Does halting the transition also cause the after callback to be ignored? Or will it always execute the after no matter what? </p>
  
  <p>If this last thing is true, how do I pass state into that callback?</p>
  
  <p>thanks in advance, and let me know if you need more information...</p>
  
  <p>jd</p>