title: belongs_to association conflicts when instantiating, "Validation failed... must exist" error
body: <p>this is how I did the associations: </p>
  
  <pre><code>class Event &lt; ApplicationRecord
    has_one :lineup
    has_many :artists, :through =&gt; :lineup
    belongs_to :venue
  end
  </code></pre>
  
  <p>and </p>
  
  <pre><code>class Lineup &lt; ApplicationRecord
    belongs_to :artist
    belongs_to :event
  end
  </code></pre>
  
  <p>this is how I'm trying to seed </p>
  
  <pre><code>Event.create!(name: "The Function", 
                date: DateTime.new(2016,2,3,10,0,0,'+7'), 
                venue: Venue.create!(name: "Speakeasy", address: "Lynwood Ave", zip_code: "30312"), 
                lineup: Lineup.create!(:artist =&gt; Artist.create!(name: "DJ Sliink", bio: "jersey club king")), 
                description: "free free free")
  </code></pre>
  
  <p>the error that I get is <code>ActiveRecord::RecordInvalid: Validation failed: Event must exist</code> which points to the <code>lineup</code> line. I get the same message if I set <code>lineup: nil</code>, then once the <code>Event</code> is created, try to do <code>event1.lineup = Lineup.create!...</code> . What are my options for getting rid of Lineup's dependency on the Event existing? From what I understand, the problem lies in the <code>belongs_to</code> relationship, because if I take out the <code>artist:</code> from the Lineup instance creation, I also get the <code>Artist must exist</code> error. </p>
  
  <p>validations: </p>
  
  <pre><code>&gt; Event.validators
   =&gt; [#&lt;ActiveRecord::Validations::PresenceValidator:0x007fcaab69fa78 @attributes=[:venue], @options={:message=&gt;:required}&gt;]
  
  &gt; Lineup.validators
   =&gt; [#&lt;ActiveRecord::Validations::PresenceValidator:0x007fcaad988238 @attributes=[:artist], @options={:message=&gt;:required}&gt;, #&lt;ActiveRecord::Validations::PresenceValidator:0x007fcaab77c7c0 @attributes=[:event], @options={:message=&gt;:required}&gt;]
  </code></pre>
  
  <p>without the <code>!</code>s in seed file, I get a whole different error - <code>ActiveRecord::AssociationTypeMismatch: Venue(#70094220768860) expected, got Fixnum(#70094214808600)</code>, though still for the <code>event = Event.create</code> line. </p>