Hi,

coming from AAF I would like to use (complex) boolean filters/
conditions.
To be more specific I want to get items visible only to the current
user, in AR this is done with a named_scope (simplyfied):

class Event
  named_scope :visible_to, lambda {|user|  :conditions => ['visibility
= 'public' OR (visibility = 'private' AND user_id = ?)', user.id]  }
end
Event.visible_to(current_user).all ...
With AAF the following works:
Event.visible_to(current_user).find_with_ferret('query' ...)

It doesn't work with TS. I can't add :conditions => ... with this kind
of boolean filter. And if I try this:

Event.visible_to(current_user).search 'query'

I get errors because the returned array has the length of the result
list returned by TS (without AR filtering) although I can see in my
logs that the AR conditions have been used. There are simply NIL
objects in the returned list. This is really useless especially if I
want to use will_paginate.

- Jan

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" 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/thinking-sphinx?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to