title: Rails Preloading is not working with polymorphic relation
body: <pre><code>class Project &lt; ActiveRecord::Base
   has_many :photos, -&gt; { order(main: :desc, id: :asc) }, as: :photoable, class_name: 'Photo', dependent: :destroy
  </code></pre>
  
  <hr>
  
  <pre><code>class Photo &lt; ActiveRecord::Base
    belongs_to :photoable, polymorphic: true
  </code></pre>
  
  <hr>
  
  <pre><code>projects = Project.limit(10).includes(:photos)
  
  SELECT  "projects".* FROM "projects" WHERE "projects"."is_deleted" = $1 LIMIT 10  [["is_deleted", "f"]]
  Photo Load (0.5ms)  SELECT "photos".* FROM "photos" WHERE "photos"."photoable_type" = 'Project' AND "photos"."photoable_id" IN (1, 403, 371, 8784, 12, 34, 11, 1111, 31, 22)  ORDER BY "photos"."main" DESC, "photos"."id" ASC
  </code></pre>
  
  <hr>
  
  <pre><code> projects.first.photo
   Photo Load (0.6ms)  
  </code></pre>
  
  <p>It is sending a DB query which gets executed in (0.6ms). Any idea how i can avoid a DB query ?</p>
  
  <p>I'm using Rails 4.2.6 &amp; Ruby 2.3.1p112 </p>