Any ideas on this? Am I taking the wrong approach? On Jul 30, 7:58 am, "Sean Clark Hess" <seanh...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello all, > I''m trying to use acts_as_ferret to not only search for records, but to > combine it with a filter function that filters those results by other things > as well. > > http://pastie.textmate.org/244035 > > That gives an example of the Game.filter function. It is supposed to take a > hash of parameters, and give you the filtered results. The parameters this > is supposed to support are: players - the number of players, category - a > habtm relationship, and q - a search query (on title or description). > > First, if my approach to a filter function is totally wrong let me know. > This seems like it should work, but {:players => 2} gives me "wrong number > of bind variables (2 for 1) in: games.id in (?) and min_players <= :players > and max_players >= :players". I get the same type of error if I send it a > category as well, or if I combine either with a search query. > > The logger is outputting the hash for final_conditions as I expect. Also, > this works fine if I leave out the searching, so if I changed the last line > to > > results = Game.find(:all, :conditions => finalconditions, :include => > includes) > > It works, but leaves out the search query in the filter. > > Thanks for your help! > ~sean--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---