title: accepts_nested_attributes_for doesn't work properly for has_one relationship
body: <p>I'm having trouble with accepts_nested_attributes_for in a has_one relationship.</p>
  
  <p>The models: Purchase and Sale.</p>
  
  <pre><code>class Purchase &lt; ActiveRecord::Base 
    has_one :sale, :dependent =&gt; :destroy
    accepts_nested_attributes_for :sale
  end
  
  class Sale &lt; ActiveRecord::Base  
    belongs_to :purchase
  end
  </code></pre>
  
  <p>In the controller/new action:</p>
  
  <pre><code>@purchase = Purchase.new(
    :club_id =&gt; @club.id,
    :subcategory_id =&gt; subcategory.id
  )
  </code></pre>
  
  <p>In the view (HAML):</p>
  
  <pre><code>- form_for(@purchase) do |f|
    # some fields for purchase
    - f.fields_for :sale do |s|
      = s.text_field :amount, :size =&gt; 6
      # and so on
  </code></pre>
  
  <p>PROBLEM: this does not actually render any input boxes for sale in my view.  The purchase fields render fine, but the sale fields do not appear.</p>
  
  <p>If I add this line to the controller:</p>
  
  <pre><code>@purchase.sale.build
  </code></pre>
  
  <p>I get this error:</p>
  
  <blockquote>
    <p>undefined method `build' for nil:NilClass</p>
  </blockquote>
  
  <p>To make things weirder, if I change the association type to has_many instead of has_one, thus creating:</p>
  
  <pre><code>class Purchase &lt; ActiveRecord::Base 
    has_many :sales, :dependent =&gt; :destroy
    accepts_nested_attributes_for :sales
  end
  </code></pre>
  
  <p>Everything starts working just fine - the sale fields start appearing in my view, @purchase.sales.build does not return an error, and so on.  Of course, this doesn't really help me, since it's supposed to be has_many, not has_one.</p>