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

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

python 2.7 - Lines in my code being skipped and I am not sure why -

python - multiprocessing pool with map -