title: ActiveRecord belongs_to association does not save foreign_key (Rails 4)
body: <p>This weekend I decided to take Rails 4 for a spin and promptly ran into the following issue:</p>
  
  <p>I have two models (wanted to try an OpenSchema incase you are wondering):</p>
  
  <h3>Record</h3>
  
  <pre><code>has_many :ns_attributes
  </code></pre>
  
  <h3>NsAttribute</h3>
  
  <pre><code>belongs_to :record
  </code></pre>
  
  <p>Now in the console:</p>
  
  <pre><code>record = Record.create!(name: "blowing in the wind")
  nsa = NsAttribute.new(key: "artist", value: "bob dylan", record: record)
  
  
  #&lt;NsAttribute id: nil, key: "artist", value: "bob dylan", record_id: 4, created_at: nil, updated_at: nil&gt;
  
  irb(main):007:0&gt; nsa.save!
  (0.4ms)  BEGIN
  Record Exists (0.7ms)  SELECT 1 AS one FROM "records" WHERE "records"."name" IS NULL LIMIT 1
  (0.2ms)  COMMIT
  =&gt; true
  irb(main):008:0&gt; nsa
  =&gt; #&lt;NsAttribute id: nil, key: "artist", value: "bob dylan", record_id: nil, created_at: nil, updated_at: nil&gt;
  </code></pre>
  
  <p>As you can see the record did not get saved (record_id: nil). </p>
  
  <ul>
  <li>I also tried adding class_name and foreign_key to the belongs_to method without a change.</li>
  <li>Could it be because of of the AR model name? ("record")</li>
  <li>There are no validations on the two models</li>
  </ul>
  
  <p>Any clues as to whats going on are appreciated!</p>