Quick typo spot - not sure if it's just a cut-and-paste error though:

You're using :themes_category_id in the :with hash, but have called  
the attribute :theme_category_id.

-- 
Pat

On 18/05/2009, at 3:20 PM, Zoran wrote:

>
> Can somebody explain this behavior?
>
> class Tip < ActiveRecord::Base
>  belongs_to :theme, :include => :category
>
>  define_index do
>    has theme.category(:id), :as => :theme_category_id, :type
> => :integer
>  end
>
> end
>
>
> find works:
>
> Tip.find(:all, :joins => :theme, :conditions => ["themes.category_id
> = ?", 1]) ----> true
> Tip.find(:all, :joins => :theme, :conditions => ["themes.category_id
> = ?", 2]) ----> false
>
>
> search ignores :with and returns always a result:
>
> Tip.search :with => {:themes_category_id => 1} ----> true
> Tip.search :with => {:themes_category_id => 2} ----> true
> Tip.search :with => {:xxx_themes_category_id_xxx => 2234234.234} ---->
> true
>
> >


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