title: Kohana 3.2, ORM has_many, belongs_to relationship not referencing the correct key
body: <p>I have two tables named <code>utilities</code> and <code>types</code> that i am trying to access the other fields within types from the utilities view. e.g; <code>$utilities-&gt;type-&gt;type;</code></p>
  
  <p>Utilities would <code>have_one</code> type
  and type would <code>belong_to</code> utility right?</p>
  
  <p>This is how i have it currently, and rather than referencing <code>utilities.type_id</code> its setting the key as <code>utilities.id</code>. As a result its pulling different types for each row, even though they are all of the same type.</p>
  
  <p><img src="https://i.stack.imgur.com/cps3C.jpg" alt="enter image description here"></p>
  
  <p>How should i lay my models relationships out using Kohana 3.2 ORM.</p>
  
  <h2>Utilities</h2>
  
  <pre><code>&lt;?php
  class Model_Utility extends ORM {
      protected $_has_one = array(
          'type' =&gt; array(
              'model' =&gt; 'type',
              'foreign_key' =&gt; 'type_id',
          ),
      );
  </code></pre>
  
  <h3>Table Structure</h3>
  
  <pre><code>+---------------+--------------+------+-----+---------+----------------+
  | Field         | Type         | Null | Key | Default | Extra          |
  +---------------+--------------+------+-----+---------+----------------+
  | id            | int(11)      | NO   | PRI | NULL    | auto_increment |
  | utility_name  | varchar(255) | NO   |     | NULL    |                |
  | type_id       | int(11)      | NO   |     | NULL    |                |
  | contact_name  | varchar(255) | NO   |     | NULL    |                |
  | contact_email | varchar(255) | NO   |     | NULL    |                |
  | contact_phone | varchar(255) | NO   |     | NULL    |                |
  +---------------+--------------+------+-----+---------+----------------+
  </code></pre>
  
  <h2>Types</h2>
  
  <pre><code>class Model_Type extends ORM {
      protected $_belongs_to = array(
          'utility' =&gt; array(
          )
      );
  </code></pre>
  
  <h3>Table Structure</h3>
  
  <pre><code>+---------+--------------+------+-----+---------+----------------+
  | Field   | Type         | Null | Key | Default | Extra          |
  +---------+--------------+------+-----+---------+----------------+
  | type_id | int(11)      | NO   | PRI | NULL    | auto_increment |
  | type    | varchar(255) | NO   |     | NULL    |                |
  +---------+--------------+------+-----+---------+----------------+
  </code></pre>