Merge branch 'master' into 6859-fix-invalid-manifests
[arvados.git] / services / api / lib / record_filters.rb
index c009bf537f1966fd16326ef3bc239c7d6d623f99..350c3802fc60e606fd0dba703429ca7dc98f847e 100644 (file)
@@ -77,7 +77,12 @@ module RecordFilters
                                     "boolean attribute '#{attr}'")
               end
             end
-            cond_out << "#{ar_table_name}.#{attr} #{operator} ?"
+            if operator == '<>'
+              # explicitly allow NULL
+              cond_out << "#{ar_table_name}.#{attr} #{operator} ? OR #{ar_table_name}.#{attr} IS NULL"
+            else
+              cond_out << "#{ar_table_name}.#{attr} #{operator} ?"
+            end
             if (# any operator that operates on value rather than
                 # representation:
                 operator.match(/[<=>]/) and (attr_type == :datetime))