title: Rails ActiveRecord Association
body: <p>Okay, so here is my question.  I have a 3 different models, People, Roles, Client, and Store.  Clients have many Stores and can also have many people.  Stores have many people.  People have various roles.  1 Person can work at multiple stores, and they may have different roles at each store.  </p>
  
  <p>For example.  Joe may be an assistant manager at one store and a manager at another store.  What I would like to be able to do is pull the correct roles by doing something like   <pre>Store.find(1).people.find(1).roles</pre> (would return 'assistant manager' for example) or  </p>
  
  <p><pre>Store.find(2).people.find(1).roles</pre> (would return 'manager' for example).  Is this possible to do in ActiveRecord?</p>
  
  <p>I've created a table :roles_people which has the following definition:</p>
  
  <pre>
  create_table :roles_people, :id => false do |t|
        t.references :role
        t.references :person
        t.references :store
        t.references :client
  end
  </pre>
  
  <p>However i can't figure out how to get associations to work properly using this table.  Can anyone point me in the right direction?</p>
  
  <p>Thanks</p>