title: Rails has_and_belongs_to_many is confusing me with fixtures and factories
body: <p><strong>General Confusion</strong><br/>
  I have bands which can have 3 genres. I read in a <a href="https://stackoverflow.com/questions/918743/multiple-foreign-keys-referenced-in-a-single-rails-model">previous SO post</a> that the proper way to handle this is a couple steps:</p>
  
  <p>1) In band.rb</p>
  
  <pre><code>has_and_belongs_to_many :genres
  </code></pre>
  
  <p>2) Create a band_genres join table</p>
  
  <p>Even after reading the documentation, I am a bit confused as to what HABTM actually means.  I guess I would just normally think "a band has many genres", not has and belongs to many.  So a quick DUMBED down explanation of that would be great.</p>
  
  <p><strong>Confusion with Fixtures</strong></p>
  
  <p>Also, when doing my fixture for band_genres I have </p>
  
  <pre><code>{ 
    "The Reaper Band and Funk": { "band": "The Reaper Band", "genre": "Funk" },
    "The Reaper Band and Rock": { "band": "The Reaper Band", "genre": "Rock" }  
  }
  </code></pre>
  
  <p>And I get a "unknown" band column.  I thought rails was supposed to know that "The Reaper Band" would refer to a band from a band fixture (same name of course) and would grab that id and know that "band" in this fixture would refer to band_id in the join table.  I would rather my fixtures look like this than have hard coded numbers.</p>
  
  <p><strong>Confusion With Factories</strong></p>
  
  <p>When I create a band in my factory, I want to assign it genres:</p>
  
  <pre><code>Factory.define :band do |f|
    f.sequence(:name) { |n| "Band#{n}" }
    f.mailing_lists { |mailing_lists| [mailing_lists.association(:mailing_list)] }
    f.genres 2
  end
  </code></pre>
  
  <p>I realize here I would probably need a hard coded genre_id.  But why doesn't rails look at that and say "oh, he wants to add genre with id=2 to the band_genres table".  </p>
  
  <p>I am not expecting rails to take care of all the dirty work for me, but I do want to play by the rules.</p>