Ruby Forum Ferret > Conditions are not working

Posted by Sean Schofield (schof)
on 25.06.2008 19:26
My conditions do not seem to be having no effect on the ferret search.
The search results are correct (they return the right values based on my
search terms) but they are not limiting the results as I would expect.

class Asset < ActiveRecord::Base
  acts_as_ferret :fields => [:identifier, :description]
end

>> Asset.find_with_ferret("smoke", :conditions => ["identifier = ?", "F"])


I am using the stable version of plugin and the latest gem.  I am also
using Rails 2.1.

If I could get simple conditions working I would also like to use
:include to join another model and further limit my records.  Any idea
if that is possible?

TIA,

Sean
Posted by Sean Schofield (schof)
on 26.06.2008 19:31
Fixed my problem (there was a missing empty options hash

>> Asset.find_with_ferret("smoke", {}, :conditions => ["identifier = ?", "F"])