Hey all,

Hoping for some direction/thoughts. I have a model Beneficiary which has 
the following associations (the first one is the impt one that is bombing 
with sphinx):
has_one :beneficiary_datum, :conditions => Proc.new { "year = 
#{self.current_data_year}" }

has_one   :activity_description_original,
            :through => :beneficiary_datum,
            :source => :beneficiary_datum_entries,
            :conditions => {:entry => 
't3010_activity_description_original'},
            :select => 'text_value'

I'd like to use that association in my sphinx index like so:
  indexes activity_description_original.text_value, :as => 
:activity_description_original

When attempting to generate the index config it fails with this:
undefined local variable or method `current_data_year' for 
#<ActiveRecord::Associations::JoinDependency::JoinAssociation:0x007fcfaa780998>

Is it possible to use the model attribute as a condition like I'm trying to 
do?

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/thinking-sphinx/-/nowJ1hswtPIJ.
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