On Oct 17, 6:29 pm, "Rahul J." <[email protected]> wrote: > Hi Colin, > I don't prefer associations here, coz i'll be having a large list of > questions approx 50) and associated answers(approx. 500), so i don't > want to fetch users record along with all those. > @Fred : I am not getting that field as "username" is not in question Ar, > but its in Users. > > How can i specify the fields that are not in model but are retrieved > through sql to be stored in some instance variables. >
You don't need to do anything - anything in the select clause is available. It doesn't show up in the output of inspect (which is what you see if you're playing around in the console) but you can still call @question.username. Fred > Thanks, > Rahul > > -- > Posted viahttp://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

