From: Dan __ Date: 2008-06-30T00:46:04+09:00 Subject: Re: Recursive Logic - Examples and Resources? Matt Darby wrote: >> So, if the set is 1 2 3 4 5 6 7 8 9 10, and User1 has (9, 17), while >> User2 has (3, 7), User2 could be part of the set, while User1 could not. > > This approach is pretty naive, but it might work: > > range = 0...10 > User.find(:all, :conditions => ["num1 IN (?) and num2 IN (?)", range, > range]) Thanks for the suggestion Matt, it seems like a good start. That seems like it would just return every user that fit into the set though, and not five to make up a set. As well, I'd like to avoid using SQL code if I could, because I'm not sure which database the final app will use/how often it'll switch (its using PostgreSQL right now, but that might have to switch depending on hosting, etc.). -- Posted via http://www.ruby-forum.com/.