Merge branch '14596-check-container-locked'
[arvados.git] / services / api / lib / record_filters.rb
index 9839413fcde3df58e036d82494c60f1dcfc3fec5..831e357b4235b6b11217de47ee2c5960a4ef3563 100644 (file)
@@ -197,9 +197,14 @@ module RecordFilters
             operand.each do |op|
               cl = ArvadosModel::kind_class op
               if cl
-                if attr == 'uuid' and model_class.uuid_prefix == cl.uuid_prefix
-                  cond << "1=1"
+                if attr == 'uuid'
+                  if model_class.uuid_prefix == cl.uuid_prefix
+                    cond << "1=1"
+                  else
+                    cond << "1=0"
+                  end
                 else
+                  # Use a substring query to support remote uuids
                   cond << "substring(#{ar_table_name}.#{attr}, 7, 5) = ?"
                   param_out << cl.uuid_prefix
                 end