From: Jean-Philippe Lang Date: Wed, 23 Jan 2008 20:07:17 +0000 (+0000) Subject: Fixed: Incorrect filtering for unset values when using 'is not' filter. X-Git-Tag: 0.7.0-RC1~188 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2247700f24ae6858ace3de11ea88ec45f43d5dd7;p=redmine.git 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 --- 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 "*"