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
This commit is contained in:
parent
d8ac6d2b79
commit
2247700f24
|
@ -300,7 +300,7 @@ class Query < ActiveRecord::Base
|
||||||
when "="
|
when "="
|
||||||
sql = sql + "#{db_table}.#{db_field} IN (" + v.collect{|val| "'#{connection.quote_string(val)}'"}.join(",") + ")"
|
sql = sql + "#{db_table}.#{db_field} IN (" + v.collect{|val| "'#{connection.quote_string(val)}'"}.join(",") + ")"
|
||||||
when "!"
|
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 "!*"
|
when "!*"
|
||||||
sql = sql + "#{db_table}.#{db_field} IS NULL"
|
sql = sql + "#{db_table}.#{db_field} IS NULL"
|
||||||
when "*"
|
when "*"
|
||||||
|
|
Loading…
Reference in New Issue