title: AASM is not working with my rails 3 and ruby 1.8.7 ( undefined method `name' for nil:NilClass )
body: <p>I'm using Rails 3.2.2, with aasm gem, I have <code>Document</code> model this way: </p>
  
  <pre><code>class Document &lt; ActiveRecord::Base
    include AASM
  
    aasm do  
      state :unread, :initial =&gt; true
      state :read
      state :closed
  
      event :view do
        transitions :to =&gt; :read, :from =&gt; [:unread]
      end
  
      event :close do
        transitions :to =&gt; :closed, :from =&gt; [:read, :unread]
      end
    end
  </code></pre>
  
  <p>now on my console: </p>
  
  <pre><code>➜  ✗ bundle exec rails c
  Loading development environment (Rails 3.2.2)
  irb(main):006:0&gt; Document.create!(:title =&gt; 'test')
     (0.2ms)  BEGIN
    SQL (0.3ms)  INSERT INTO `documents` (`aasm_state`, `checklist_id`, `created_at`, `description`, `dir`, `planned_date`, `procedure_id`, `section`, `subsection`, `title`, `updated_at`) VALUES (0, NULL, '2012-06-16 20:03:18', NULL, NULL, NULL, NULL, NULL, NULL, 'test', '2012-06-16 20:03:18')
     (0.4ms)  COMMIT
  =&gt; #&lt;Document id: 28, title: "test", description: nil, dir: nil, section: nil, subsection: nil, planned_date: nil, procedure_id: nil, checklist_id: nil, created_at: "2012-06-16 20:03:18", updated_at: "2012-06-16 20:03:18", aasm_state: 0&gt;
  irb(main):007:0&gt; doc = Document.last
    Document Load (0.3ms)  SELECT `documents`.* FROM `documents` ORDER BY `documents`.`id` DESC LIMIT 1
  =&gt; #&lt;Document id: 28, title: "test", description: nil, dir: nil, section: nil, subsection: nil, planned_date: nil, procedure_id: nil, checklist_id: nil, created_at: "2012-06-16 20:03:18", updated_at: "2012-06-16 20:03:18", aasm_state: 0&gt;
  irb(main):008:0&gt; doc.view!
  NoMethodError: undefined method `name' for nil:NilClass
      from /Library/Ruby/Gems/1.8/gems/aasm-3.0.6/lib/aasm/supporting_classes/state.rb:15:in `=='
      from /Library/Ruby/Gems/1.8/gems/aasm-3.0.6/lib/aasm/aasm.rb:143:in `aasm_state_object_for_state'
      from (irb):8:in `find'
      from /Library/Ruby/Gems/1.8/gems/aasm-3.0.6/lib/aasm/aasm.rb:143:in `each'
      from /Library/Ruby/Gems/1.8/gems/aasm-3.0.6/lib/aasm/aasm.rb:143:in `find'
      from /Library/Ruby/Gems/1.8/gems/aasm-3.0.6/lib/aasm/aasm.rb:143:in `aasm_state_object_for_state'
      from /Library/Ruby/Gems/1.8/gems/aasm-3.0.6/lib/aasm/aasm.rb:158:in `aasm_fire_event'
      from /Library/Ruby/Gems/1.8/gems/aasm-3.0.6/lib/aasm/base.rb:48:in `view!'
      from (irb):8    
  </code></pre>
  
  <p>As you can see I keep getting</p>
  
  <blockquote>
    <p>undefined method `name' for nil:NilClass</p>
  </blockquote>
  
  <p>I'm using Ruby 1.8.7.</p>