From: Peter Amstutz Date: Mon, 4 May 2020 21:27:15 +0000 (-0400) Subject: 16007: Remember to set trash_at in trashed_groups. X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/e77609d17994548cd5abed7a0d25517c10c73327 16007: Remember to set trash_at in trashed_groups. Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- 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));