我想过滤我班级的私有布尔值,因此它只显示非私有但对我不起作用的资源。(我大大简化了代码)
mapping do
indexes :private, type: "boolean"
indexes :name, type: "string"
end
end
def self.search(params)
tire.search(load: true, page: params[:page], per_page: 20) do
query { string params[:query] } if params[:query].present?
# So far I've tried...
# filter :bool, :private => ["false"]
# filter :bool, private: false
end
end
我该如何正确地做到这一点?