title: rails workflow gem method missing error state machine
body: <p>I am having a bit of trouble with the 'workflow' gem, namely, the transitions aren't working.  </p>
  
  <p>What I am trying to do is very basic, I have a 'read/unread' state for messages between users, the transition is triggered when the user goes to a 'show' page for that specific message.  However, I can't seem to get the transition to work, even in the console:</p>
  
  <pre><code>\\ message.rb
  
  class Message &lt; ActiveRecord::Base
      include Workflow
  
      workflow do
          state :unread do
            event :view, :transitions_to =&gt; :read
          end
          state :read
      end
  end
  </code></pre>
  
  <p>in the console, when I try to make this transition, I use the following code and get the following output:</p>
  
  <pre><code>&gt;&gt; message = Message.new
  =&gt; #&lt;Message id: nil, user_id: nil, message: nil, created_at: nil, u
  pdated_at: nil&gt;
  &gt;&gt; message.current_state
  =&gt; #&lt;Workflow::State:0x7ed4febc @name=:unread, @events={:view=&gt;#&lt;Workflow:
  :Event:0x7ed4fd90 @action=nil, @name=:view, @transitions_to=:read, @meta={}
  &gt;}, @meta={}&gt;
  &gt;&gt; message.unread?
  =&gt; true
  &gt;&gt; message.view!
  NoMethodError: undefined method `workflow_state=' for #&lt;Message:0x7ecfd5a4&gt;
          from /home/Ryan/.bundle/ruby/1.8/gems/activerecord-2.3.8/lib/active_reco
  rd/attribute_methods.rb:259:in `method_missing'
          from /home/Ryan/.bundle/ruby/1.8/gems/activerecord-2.3.8/lib/active_reco
  rd/base.rb:2656:in `send'
          from /home/Ryan/.bundle/ruby/1.8/gems/activerecord-2.3.8/lib/active_reco
  rd/base.rb:2656:in `update_attribute'
          from /home/Ryan/.bundle/ruby/1.8/gems/workflow-0.7.0/lib/workflow.rb:272
  :in `persist_workflow_state'
          from /home/Ryan/.bundle/ruby/1.8/gems/workflow-0.7.0/lib/workflow.rb:211
  :in `transition'
          from /home/Ryan/.bundle/ruby/1.8/gems/workflow-0.7.0/lib/workflow.rb:165
  :in `process_event!'
          from /home/Ryan/.bundle/ruby/1.8/gems/workflow-0.7.0/lib/workflow.rb:124
  :in `view!'
          from (irb):25
  </code></pre>
  
  <p>I can't find ANYTHING about what is going on here, from googleing and even tried looking in: /home/Ryan/.bundle/ruby/1.8/gems/workflow-0.7.0/lib/workflow.rb but I can't see any reason this isn't working. This is a really simple problem and I've wracked my brain figuring out what is wrong.  </p>
  
  <p>Thanks for your help</p>