Thanks for the quick response and the logging tip.

>> But more importantly, since yesterday doing a search has caused an
>> exception:
> 
> since yesterday? What did you change?
Having looked at this again, this problem was introduced when I upgraded 
the version to the trunk and switched to the drb server.

>> A NoMethodError occurred in partners#user_search:
>> 
>>   undefined method `each' for :sales_region:Symbol
>>   [RAILS_ROOT]/vendor/plugins/acts_as_ferret/lib/class_methods.rb:246:in
>> `retrieve_records'
>> 
>> Any idea what these could have been caused by?
> 
> not yet - I can't seem to find the line the error refers too - what 
> exact
> revision are you on? Or could you try that with the latest trunk (rev.
> 247).
> 
> How do you use that symbol in your code?

I just used the trunk, how can I find out which revision it was now?

The error is caused by the following include:
@results = User.find_by_contents(@query, { 
:limit=>5000},:conditions=>"sales_regions.firm_id in 
(#{firm_id_string})",:include => :sales_region)

The code from aaf is here:
  def retrieve_records(id_arrays, find_options = {})
      result = []
      # get objects for each model
      id_arrays.each do |model, id_array|
        next if id_array.empty?
        begin
          model = model.constantize
        rescue
          raise "Please use ':store_class_name => true' if you want to 
use multi_search.\n#{$!}"
        end

        # check for include association that might only exist on some 
models in case of multi_search
        filtered_include_options = []
        if include_options = find_options[:include]
          include_options.each do |include_option|
            filtered_include_options << include_option if 
model.reflections.has_key?(include_option.is_a?(Hash) ? 
include_option.keys[0].to_sym : include_option.to_sym)
          end
        end

It's the include_options.each do |include_option| causing the problem.

Thanks for your quick responses by the way, they are amazing.

Chris.
-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to