Will Clark wrote:
> class CompanyProfile < ActiveRecord::Base
> belongs_to :sector, :counter_cache => true
> belongs_to :industry, :counter_cache => true
>
> define_index do
> indexes :name, ticker, description, profile
> indexes [sector.name, industry.name], :as => :extras
> where "active = 't'"
> end
> end
>
> When I run rake ts:in I get this error:
>
> ERROR: index 'company_profile_core': sql_range_query: ERROR: column
> reference "active" is ambiguous
>
> If I comment out the :extras index, the index will build without a
> problem.
Do your sectors or industries tables have an active column as well?
Assuming your tables follow rails naming conventions, try changing your
where line to:
where "company_profiles.active = 't'"
-- James Healy <jimmy-at-deefa-dot-com> Fri, 26 Jun 2009 09:36:35 +1000
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---