16007: Remember to set trash_at in trashed_groups.
[arvados.git] / services / api / app / models / arvados_model.rb
index 12f729813b2f87178966d7856fbaff132932bd7b..83b9a6e104faf4db736d3e1bade64301e82ca10c 100644 (file)
@@ -298,14 +298,14 @@ class ArvadosModel < ApplicationRecord
           # Only include records where the owner is not trashed
           #sql_conds = "#{sql_table}.owner_uuid NOT IN (SELECT target_uuid FROM #{PERMISSION_VIEW} "+
           #            "WHERE trashed = 1) #{exclude_trashed_records}"
-          sql_conds = "#{sql_table}.owner_uuid NOT IN (SELECT * FROM trashed_groups) #{exclude_trashed_records}"
+          sql_conds = "#{sql_table}.owner_uuid NOT IN (SELECT group_uuid FROM trashed_groups where trash_at < clock_timestamp()) #{exclude_trashed_records}"
         end
       end
     else
       trashed_check = ""
       if !include_trash then
         #trashed_check = "AND trashed = 0"
-        trashed_check = "AND target_uuid NOT IN (SELECT * FROM trashed_groups)"
+        trashed_check = "AND target_uuid NOT IN (SELECT group_uuid FROM trashed_groups where trash_at < clock_timestamp())"
       end
 
       # Note: it is possible to combine the direct_check and