title: Placing the foreign key in rails model belongs_to association
body: <p>I am a beginner to rails framework. I have a fundamental question.</p>
  
  <p>I am trying to define some models and their association referring the popular rails guides. My association looks like below.</p>
  
  <pre><code>class Person &lt; ActiveRecord::Base
    has_one :head
  end
  
  class Head &lt; ActiveRecord::Base
    belongs_to :person
  end
  </code></pre>
  
  <p>Here, I need to add the foreign_key (Persons's primary key) in the table 'head'.</p>
  
  <p>Now, if I need to get the 'head' of a 'person', rails need to scan through the head table and match the person_id. </p>
  
  <p>The straight forward way I would think is to add the foreign key in 'person' table. Then I can directly refer the 'head' from 'person' with it's ID.</p>
  
  <p>It appears that rails convention is not performance friendly. Am I missing something here?</p>