title: Rails 4 - Select using eager_load
body: <p>I'm trying to select only certain columns using <a href="http://apidock.com/rails/v4.0.2/ActiveRecord/QueryMethods/eager_load" rel="noreferrer"><code>eager_load</code></a>, but I'm facing the problem that it cancels my 'select'.</p>
  
  <p><strong>Model:</strong></p>
  
  <pre><code>class Timeline &lt; ActiveRecord::Base
      belongs_to :timeline_category, foreign_key: :timeline_category_id
      belongs_to :user, foreign_key: :user_id
      scope :with_relations, -&gt; { eager_load(:timeline_category).eager_load(:user).order(created_at: :desc) 
  end
  </code></pre>
  
  <p><strong>Query:</strong></p>
  
  <pre><code>Timeline.select('timelines.*, users.username, timeline_categories.icon').eager_load(:timeline_category).eager_load(:user)
  </code></pre>
  
  <p>I tried also:</p>
  
  <pre><code>Timeline.select('timelines.*, users.username, timeline_categories.icon').with_relations
  </code></pre>
  
  <p>For some reason, it keeps selecting all columns of all 3 tables. How can I fix it?</p>