From d33723aa841389cfc8142c15cc8a34800c4c3434 Mon Sep 17 00:00:00 2001 From: Matchu Date: Wed, 17 Nov 2010 00:30:17 -0500 Subject: [PATCH] implement condition negation manually, since removed from arel 2 --- app/models/item.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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