diff --git a/app/models/item.rb b/app/models/item.rb index 2676c998..c670e9e0 100644 --- a/app/models/item.rb +++ b/app/models/item.rb @@ -262,7 +262,7 @@ class Item < ActiveRecord::Base SearchFilterScopes << name.to_s scope "search_filter_#{name}", lambda { |str, negative| condition = yield(str) - condition = not(condition) if negative + condition = "!(#{condition.to_sql})" if negative rel = where(condition) rel = rel & args[:scope] if args[:scope] rel