title: Rails 3 - Using build -error, undefined method `build' for #<Class:0x10338c828
body: <p>I have two models:</p>
  
  <pre><code>class Thread &lt; ActiveRecord::Base
    has_many :attachments
  end
  
  class Attachment &lt; ActiveRecord::Base
    belongs_to :thread
  end
  </code></pre>
  
  <p>When creating a new thread I want to build attachments before saving. I'm doing:</p>
  
  <pre><code>@thread.attachments.build(...)
  </code></pre>
  
  <p>but that is erroring with: <code>failed with NoMethodError: undefined method `build' for #&lt;Class:0x10338c828</code></p>