title: habtm foreign key
body: <p>I tried to use habtm relationship , but I need to use a uid as foreign key </p>
  
  <pre><code>SELECT "friends".* FROM "friends" INNER JOIN "friendships" ON "friends"."uid" = "friendships"."uid" WHERE "friendships"."user_id" = 4
  #User
  has_and_belongs_to_many :friends, :class_name =&gt; "Friend", :join_table =&gt; "friendships", :association_foreign_key =&gt; "uid"
  #Friend
  has_and_belongs_to_many :users, :class_name =&gt; "User", :join_table =&gt; "friendships", :foreign_key =&gt; "uid"
  
  SELECT "friends".* FROM "friends" INNER JOIN "friendships" ON "friends"."id" = "friendships"."uid" WHERE "friendships"."user_id" = 4
  </code></pre>