title: Calling a method on initial state with AASM
body: <p>Is it possible to invoke a method when the initial state is entered when using the <a href="http://github.com/rubyist/aasm/tree/master" rel="nofollow noreferrer">AASM</a> Gem? I'd like the <code>spam_check</code> method to get called when a comment is submitted, but it doesn't seem to work.</p>
  
  <pre><code>class Comment &lt; ActiveRecord::Base
    include AASM
  
    aasm_column :state
    aasm_initial_state :submitted
    aasm_state :submitted, :enter =&gt; :spam_check
    aasm_state :approved
    aasm_state :rejected
  
    aasm_event :ham do
      transitions :to =&gt; :approved, :from =&gt; [:submitted, :rejected]
    end
  
    aasm_event :spam do
      transitions :to =&gt; :rejected, :from =&gt; [:submitted, :approved]
    end
  
    def spam_check
      # Mark the comment as spam or ham...
    end
  end
  </code></pre>