title: ActiveRecord: select for has_one
body: <p>I have the following active record model:</p>
  
  <pre><code>class Dispatch &lt; ActiveRecord::Base
    has_one :waypoint
  end
  </code></pre>
  
  <p>When accessing the waypoint object, the generated query retrieves all columns from the model:</p>
  
  <pre><code>pry(main)&gt; d.waypoint
  Waypoint Load (0.5ms) SELECT `waypoints`.* FROM `waypoints`
  WHERE `waypoints`.`waypointable_id` = &lt;dispatch_id&gt;
  LIMIT 1
  </code></pre>
  
  <p>If I want to retrieve specific columns from the dispatch's waypoint then I should use the <code>select</code> scope for <code>has_one</code> <a href="http://guides.rubyonrails.org/association_basics.html#has-one-association-reference" rel="nofollow">ApiDock reference, section 4.2.3</a>. Unfortunately, that approach throws a <code>NoMethodError</code>:</p>
  
  <pre><code>pry(main)&gt; d = Dispatch.last
  pry(main)&gt; d.waypoint.select('latitude, longitude')
  Waypoint Load (19.4ms)  SELECT `waypoints`.* FROM `waypoints`
  WHERE `waypoints`.`waypointable_id` = &lt;some_id&gt; LIMIT 1
  NoMethodError: private method `select' called for #&lt;Waypoint:0x007fe77ed79c28&gt;
  </code></pre>
  
  <p>What am I missing? I tried with ActiveRecord 4.0.11 and 4.2.0.</p>
  
  <h3>Edit</h3>
  
  <p>The underlying query should be something like this:</p>
  
  <pre><code>SELECT latitude, longitude FROM `waypoints`
  WHERE `waypoints`.`waypointable_id` = &lt;some_id&gt;
  LIMIT 1
  </code></pre>
  
  <p>I know I could just do</p>
  
  <pre><code>Waypoint.where(waypointable_id: &lt;some_id&gt;).select('latitude, longitude').last
  </code></pre>
  
  <p>but that misses the whole point of the <code>has_one</code> association. And since it is a feature specified in the docs then it should work properly, right?</p>