I'd add a second association for experiences that does the condition  
for you:

   has_many :special_experiences, :class_name =>  
"Experience", :conditions => 'display_preferences.value = 2'

Although, not sure how best to have the display_preferences join in  
that situation either, so perhaps I'm no help. Maybe add the following  
as well, and use both joins as attributes in your index?

   has_many :display_preferences, :through => :experiences

-- 
Pat

On 11/08/2009, at 8:54 PM, steve wrote:

>
> Having trouble coming up with a way to generate the right sql config
> for this.
>
> User
> has_many :experiences
>
> Experience
> has_one :display_preference
> attr value
>
> Need to index experiences where display_preference.value = 2
>
> Having trouble getting the display preference join in correctly.
>
> Thanks
>
> >


--~--~---------~--~----~------------~-------~--~----~
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