title: Ruby on Rails - Foreign key to reference index other than primary key
body: <p>In Ruby on Rails, how can I create relationship in which foreign key references field other than primary key? How to do that in migration or in model class? I am using MySQL.</p>
  
  <p>Thanks, </p>
  
  <p>Edit: Lets say I have two table A and B. In B, i have a field called name and in A I have b_name. How do I specify that</p>