Im trying to exclude current_user.id from my Tire search results but cannot figure how to pass a param to Tire and use that instead of a fixed value for search. How could one pass the current_user.id to the model and exclude it in search results?
Activerecord way:
Profile.where("user_id != ?", current_user.id)
My tire search block:
if params['people']
tire.search(load: true, page: params[:page], per_page: 20, :default_operator => 'AND') do
query do
boolean do
must_not { string 'user_id: 1' } <== this works hardcoded
must_not { string 'user_id: < instead of 1 user current_user.id pass in true params?' }
end
end
to_curl
end
end