I have a model in Rails representing stores
class Store < ActiveRecord::Base
A boolean field "draft" in this model determines if the record is active or if it's just a draft. I'm using acts_as_xapian to do searches in my application and it receives a model where the search should be performed. This part is working. However, I only want to run the search only on items that are active (draft==false)
I'm not sure how I can restrict the search on acts_as_xapian, but I could do the same by creating a new model which contains only the items from the class Store with draft==false.
Initially I thought I could use a method with a find
def self.active
find :all, :conditions => {:draft => false}
end
but acts_as_xapian really wants a model.
Any suggestions?