ruby on rails - Chaining ActiveRecord::QueryMethods#select returns additional records -


i'm having strange situation calling article.comments doesn't bring records should, if add `select, comes up. i'm seeing things this:

article.comments               #=> [] article.comments.select(:id)   #=> [#<comment:0x12341234 id: 1>] 

took @ sql , there's no difference, it's selecting comments.* vs comments.id. responsible this?


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -