title: Why am I getting this "undefined method `#<ActiveRecord::Associations::CollectionProxy::ActiveRecord_Associations_CollectionProxy_Survey" error?
body: <p>I have the following associations:</p>
  
  <pre><code>class Question &lt; ActiveRecord::Base
    has_and_belongs_to_many :footnotes
    has_and_belongs_to_many :pictures
    has_many :fields, :dependent =&gt; :destroy
    has_many :surveys, :dependent =&gt; :delete_all
    belongs_to :input
    belongs_to :element
    has_many :screenshots
    belongs_to :standard, :touch =&gt; true
    belongs_to :product, :touch =&gt; true
    belongs_to :condition, :class_name =&gt; "Field", :touch =&gt; true
  end
  
  class Product &lt; ActiveRecord::Base
    has_many :questions, :dependent =&gt; :destroy
    has_many :reviews
    has_and_belongs_to_many :orders
    has_many :competitors
    has_many :elements, :dependent =&gt; :destroy
    has_many :fields
  end
  
  class Element &lt; ActiveRecord::Base
    has_many :questions
    has_many :standards
    belongs_to :product, :touch =&gt; true
  end
  
  class Standard &lt; ActiveRecord::Base
    has_many :questions
    has_many :standards
    belongs_to :review
  end
  
  class Footnote &lt; ActiveRecord::Base
    belongs_to :reference, :touch =&gt; true
    has_and_belongs_to_many :questions
  end
  </code></pre>
  
  <p>Why, then, do I get the following?</p>
  
  <pre><code>From: /Users/steven/Dropbox/Testivate/app/controllers/questions_controller.rb @ line 80 QuestionsController#update:
  
      79: def update
   =&gt; 80:   binding.pry_remote
      81:   @question = Question.find(params[:id])
      82:   @question.update_attributes(params[:question])
      83:   @question.update_columns :product_id =&gt; @question.element.product.id
      84:   flash[:notice] = "Question was successfully updated. (#{undo_link(@question)}.)" if @question.save
      85:   respond_with @question
      86: end
  
  [1] pry(#&lt;QuestionsController&gt;)&gt; @question = Question.find(params[:id])
  +----+-----+-----+-----+-----+-----+------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
  | id | sta | des | ele | con | cre | upda | add | ins | act | ite | pro | inp | man | abo | res | lev | com | met |
  +----+-----+-----+-----+-----+-----+------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
  | 1  | 1   | Is  | 1   |     | 201 | 2014 | tru | On  | fal | 1   | 1   |     | fal |     |     | 0   | fal | fal |
  +----+-----+-----+-----+-----+-----+------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
  1 row in set
  [2] pry(#&lt;QuestionsController&gt;)&gt; params
  =&gt; {"utf8"=&gt;"✓",
   "_method"=&gt;"patch",
   "question"=&gt;
    {"description"=&gt;"Is it readable?",
     "element_id"=&gt;"1",
     "standard_id"=&gt;"1",
     "about"=&gt;"",
     "additive"=&gt;"true",
     "iterations"=&gt;"1",
     "instructions"=&gt;"On the homepage, there is:",
     "picture_ids"=&gt;[""],
     "footnote_ids"=&gt;[""],
     "active"=&gt;"0",
     "manual"=&gt;"0"},
   "commit"=&gt;"Update Question",
   "action"=&gt;"update",
   "controller"=&gt;"questions",
   "id"=&gt;"1"}
  [3] pry(#&lt;QuestionsController&gt;)&gt; @question.save
  =&gt; true
  [4] pry(#&lt;QuestionsController&gt;)&gt; @question.update_attributes(params[:question])
  NoMethodError: undefined method `#&lt;ActiveRecord::Associations::CollectionProxy::ActiveRecord_Associations_CollectionProxy_Survey:0x0000010b21ce90&gt;' for #&lt;Question:0x0000010c0dda38&gt;
  from /Users/steven/.rvm/gems/ruby-2.1.0/gems/activemodel-4.0.2/lib/active_model/attribute_methods.rb:439:in `method_missing'
  </code></pre>