From 2247700f24ae6858ace3de11ea88ec45f43d5dd7 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Wed, 23 Jan 2008 20:07:17 +0000 Subject: [PATCH] Fixed: Incorrect filtering for unset values when using 'is not' filter. git-svn-id: http://redmine.rubyforge.org/svn/trunk@1098 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/query.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/query.rb b/app/models/query.rb index 3a1b5a19e..adfd5f42a 100644 --- a/app/models/query.rb +++ b/app/models/query.rb @@ -300,7 +300,7 @@ class Query < ActiveRecord::Base when "=" sql = sql + "#{db_table}.#{db_field} IN (" + v.collect{|val| "'#{connection.quote_string(val)}'"}.join(",") + ")" when "!" - sql = sql + "#{db_table}.#{db_field} NOT IN (" + v.collect{|val| "'#{connection.quote_string(val)}'"}.join(",") + ")" + sql = sql + "(#{db_table}.#{db_field} IS NULL OR #{db_table}.#{db_field} NOT IN (" + v.collect{|val| "'#{connection.quote_string(val)}'"}.join(",") + "))" when "!*" sql = sql + "#{db_table}.#{db_field} IS NULL" when "*" -- 2.39.5