Displaying 2 results from an estimated 2 matches for "combine_conditions".
2006 Nov 27
2
find_conditions in acts_as_ferret find_by_contents
Hi all,
Every time I try to add options for the find_conditions argument of
find_by_contents I get the following:
a = AnnotatedLink.find_by_contents(''test'', {}, {:conditions =>
''category_id IS NOT NULL''})
>> NoMethodError: You have a nil object when you didn''t expect it!
You might have expected an instance of Array.
The error occured while
2007 Jan 15
3
Wrong total_hits when using conditions in find_by_contents
...items - which is correct
But "hotal_hits" will still return 3 - not what I would expect.
-----------------------------
Fix for this:
1) In the acts_as_ferret plugin, find the file class_methods.rb
2) Go to line 276 where you have this code-block
[code]if results.any?
conditions = combine_conditions([ "#{table_name}.#{primary_key} in
(?)", results.keys ],
find_options[:conditions])
result = self.find(:all,
find_options.merge(:conditions => conditions))
end[/code]
and add this line:
[code]if results.any?
conditions = combine_conditions([ "#{table_name}.#{primary_...