From e77609d17994548cd5abed7a0d25517c10c73327 Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Mon, 4 May 2020 17:27:15 -0400 Subject: [PATCH] 16007: Remember to set trash_at in trashed_groups. Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- services/api/app/models/group.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/services/api/app/models/group.rb b/services/api/app/models/group.rb index f64a5b2590..551201773e 100644 --- a/services/api/app/models/group.rb +++ b/services/api/app/models/group.rb @@ -42,10 +42,12 @@ class Group < ArvadosModel if is_trashed_changed? or owner_uuid_changed? if is_trashed == true ActiveRecord::Base.connection.exec_query %{ -insert into trashed_groups (group_uuid) select * from project_subtree($1); +insert into trashed_groups (group_uuid, trash_at) + select target_uuid as group_uuid, $2 as trash_at from project_subtree($1); }, 'Group.trash_subtree', - [[nil, self.uuid]] + [[nil, self.uuid], + [nil, self.trash_at]] elsif is_trashed == false && TrashedGroup.find_by_group_uuid(self.owner_uuid).nil? ActiveRecord::Base.connection.exec_query %{ delete from trashed_groups where group_uuid in (select * from project_subtree_notrash($1)); -- 2.30.2