title: Ruby: has_one relationship with foreign key?
body: <p>I have a model called "EmployeeRecord" and it has a field called username, There is another model called "Employee" with a field called username. </p>
  
  <p>I want to create an association between the 2 models so when I do:</p>
  
  <pre><code>record = EmployeeRecord.find(1)
  record.employee // returns Employee instance
  </code></pre>
  
  <p>I was thinking I'd just need to do this, but apparently it doesn't work:</p>
  
  <pre><code>class EmployeeRecord &lt; ActiveRecord::Base
      has_one :employee, :foreign_key: username
  end
  </code></pre>
  
  <p>Assume I can't add an employee_id field to EmployeeRecord. I scoured the Rails tutorials.. and recall wanting to know how to do this months ago.. but those dang Rails tutorials glided over this.. I remember.. it made me very very angry hehe</p>
  
  <p>Any idea?</p>