[Rails] Re: activerecord variable apart from member

2010-10-20 Thread Rahul J.
Hi Colin, I don't mind your comment, but appreciate you for explaining me. Actually, its the first time i am using scripting language for my purpose and i am use to of having only needful info. In terms of complexity, there is no difference, as in both of cases (manual join or associations), th

[Rails] Re: activerecord variable apart from member

2010-10-17 Thread Rahul J.
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

[Rails] activerecord variable apart from member

2010-10-17 Thread Rahul J.
Hi, I have a table with a field of user_id. In find , i had created a join on user table to retreive the username as: @question = Question.find(params[:id], :select=>"questions.*, users.username as username",:joins=>" inner join users on users.id = questions.user_id"); I had created an instance