X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/cdf7b162906cb37d4ecf88ff6c72433bcdd8fc84..ca767f4ed048496a03355d1c695140b6a4ff56ac:/services/api/lib/record_filters.rb diff --git a/services/api/lib/record_filters.rb b/services/api/lib/record_filters.rb index d3727d30f3..01d0ae4da5 100644 --- 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 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")