title: Dealing with has_one and has_many associations with one user model
body: <p>I currently have a User model</p>
  <pre class="lang-rb prettyprint-override"><code>class User &lt; ApplicationRecord
    has_one :leases
  end
  </code></pre>
  <p>a Lease model</p>
  <pre class="lang-rb prettyprint-override"><code>class Lease &lt; ApplicationRecord  
    belongs_to :tenant, class_name: 'User'
    belongs_to :landlord, class_name: 'User'
  end
  </code></pre>
  <p>and a Rental model</p>
  <pre class="lang-rb prettyprint-override"><code>class Rental &lt; ApplicationRecord
    has_one :lease, dependent: :destroy
  end
  </code></pre>
  <p>and I only have one user model supporting tenants and landlords.</p>
  <p>The problem I'm facing is that a landlord can have multiple leases with many different tenants, but tenants can only have one lease at a time.</p>
  <p>I'm somewhat confused on how I should structure this properly. Should I have a has_many relation with the User model and the Lease model instead of the has_one and then just a method say lease on the User model to get the lease for a tenant?
  What I would like to have is something like</p>
  <pre class="lang-rb prettyprint-override"><code>tenant.lease
  </code></pre>
  <p>and</p>
  <pre class="lang-rb prettyprint-override"><code>landlord.leases
  </code></pre>
  <p>Could I just do?</p>
  <pre class="lang-rb prettyprint-override"><code>class User &lt; ApplicationRecord
    has_one :lease, foreign_key: &quot;tenant_id&quot;
    has_many :leases, foreign_key: &quot;landlord_id&quot;
  end
  </code></pre>
  <p>this seems to work, but I'm not sure if its the right way to go.</p>