From: Rick Lindal Date: 2012-10-06T02:44:27+09:00 Subject: Re: Activerecord query question Troy Surrett wrote in post #1078670: > Hi Rick, > > It's helpful to know which version of ActiveRecord you're using. Here's > my solution in ActiveRecord 3: > > Bug.joins(:longdescs) > > The Rails guide to ActiveRecord is very helpful => > http://guides.rubyonrails.org/active_record_querying.html > > From here you can do things like: > > Bug.joins(:longdescs).where ... > > Hope that helps, > -Troy Thanks Troy. It is ActiveRecord 3. Here is the solution that worked for me. bugs = Bug.joins(:longdescs).select("bugs.bug_id,bugs.bug_status,bugs.priority,bugs.bug_severity,bugs.short_desc,longdescs.thetext").where(:bug_id => ARGV) -- Posted via http://www.ruby-forum.com/.