Topic: act_as_ferret Plugin
I was wondering if we could have a conditional search using the act_as_ferret plugin
The case that I am looking forward to is an admin can search the user under him by using the first, last or the company name. The catch is that he should only search for the user under him and not for the user that are under any other admin.
The user table has an admin_id field that matches it with an admin.
class User < ActiveRecord::Base
acts_as_ferret :fields => [:first_name, :last_name, :company]
Now how can I modify the code below
@results = User.find_by_contents("Gregg")
To include a condition that would check for the admin_id..
Some thing in the lines of
@results = User.find_by_contents("Gregg",:conditions => ['admin_id = ?', params[:admin_id]])
Any help in this regard would be highly appreciated.