When I do:
temp = User.find(:all,
:joins => “INNER JOIN contents ON users.agent_id =
:select => “contents.id, users.id, users.u_date”)
It seems to work fine, but it only returns:
#<User id: 6, u_date: “2009-10-03 19:32:23”>
but not the contents.id information.
I don’t get it, and I don’t know what to do to rectify this. It seems
like since I call find on User, it only returns infos related to this
By the way, when I copy the SQL code generated by Rails directly in my
DB, it works fine and returns all 3 fields.
Do you have any idea what I am missing?
Thanks a lot!