title: ActiveModel::MissingAttributeError: can't write unknown attribute `ad_id' with FactoryGirl
body: <p>I have the following models:</p>
  
  <pre><code>class Ad &lt; ActiveRecord::Base
    belongs_to :page
  
    has_one :image
    has_one :logo
  end
  
  class Page &lt; ActiveRecord::Base
    has_many :logos
    has_many :images
    has_many :ads
  end
  
  class Image &lt; ActiveRecord::Base
    belongs_to :page
    has_many :ads
  end
  </code></pre>
  
  <p>And I have defined the following Factories:</p>
  
  <pre><code>factory :page do
    url 'test.com'
  end
  
  factory :image do
    width 200
    height 200
    page
  end
  
  factory :ad do
    background 'rgb(255,0,0)'
    page
    image
  end
  </code></pre>
  
  <p>When I try to do this:</p>
  
  <p>ad = FactoryGirl.create(:ad) I get the following error <code>ActiveModel::MissingAttributeError: can't write unknown attribute ad_id'</code> right in the line where I decide the image association in the ad Factory.</p>
  
  <p>What am I doing wrong here?</p>