projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
3220: Adjust disk corruption behavior: If both corrupt and intact
[arvados.git]
/
services
/
api
/
lib
/
record_filters.rb
diff --git
a/services/api/lib/record_filters.rb
b/services/api/lib/record_filters.rb
index d3727d30f3d661f208f089bc52f21ce7219421b6..01d0ae4da5907dbafdfa7060cea6feb1de7dea88 100644
(file)
--- a/
services/api/lib/record_filters.rb
+++ b/
services/api/lib/record_filters.rb
@@
-54,6
+54,10
@@
module RecordFilters
if operand.is_a? Array
cond_out << "#{ar_table_name}.#{attr} #{operator} (?)"
param_out << operand
if operand.is_a? Array
cond_out << "#{ar_table_name}.#{attr} #{operator} (?)"
param_out << operand
+ if operator == 'not in' and not operand.include?(nil)
+ # explicitly allow NULL
+ cond_out[-1] = "(#{cond_out[-1]} OR #{ar_table_name}.#{attr} IS NULL)"
+ end
else
raise ArgumentError.new("Invalid operand type '#{operand.class}' "\
"for '#{operator}' operator in filters")
else
raise ArgumentError.new("Invalid operand type '#{operand.class}' "\
"for '#{operator}' operator in filters")