From: "Zed A. Shaw" Date: 2006-09-25T21:45:45+09:00 Subject: Re: ruby wizards, help me beautify skanky code On Mon, 25 Sep 2006 21:24:12 +0900 "Daniel N" wrote: > On 9/25/06, Giles Bowkett wrote: > I'm assuming that you're using rails here. Maybe not... I'm trying to get > everything with one query on the db but I haven't tested it so it may not > work very well. > > @interactions = Interaction.find(:all, > :conditions => ["involvement_type > in (?)", %w(Inducer Inhibitor Substrate)], > :include => > :drugs).group_by(&:involvement_type) > Yes! That's what I was talking about. Couldn't think the voodoo up though. -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help.