Thanks a lot! What if my attribute has multiple values? For example, if a user is associated with multiple states and the model User has an attribute states that's a collection of strings how would I check that against the query you showed me? So user.states returns NY and MA, and I'm trying to see if the given user's states is in the applicable states for the rule?
I need to change the query to something like user.states in states ...but it seems like I'll have to modify yours quite a bit more! Maurício Linhares wrote: > states = [ 'CA', 'TX', 'LA' ] > find(:all, :origin => @somewhere, :within => 5, :conditions=>['state > IN ( ? )',states]) > > - > Maur�cio Linhares > http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ > (en) > > > > On Fri, Feb 20, 2009 at 4:58 PM, Naija Guy -- Posted via http://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 -~----------~----~----~----~------~----~------~--~---

