summaryrefslogtreecommitdiff
path: root/app/services/groups/destroy_service.rb
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2019-04-08 15:33:36 +0200
committerKamil Trzciński <ayufan@ayufan.eu>2019-04-15 13:05:14 +0200
commit650f40865e5d8136cb366fbde689c4100aafb0c5 (patch)
treef740d9f235693ad8e2a3693d6ec30dee26d2a74a /app/services/groups/destroy_service.rb
parent7457c1e1229cd1e90e608e8b247e2fbb217f05b6 (diff)
downloadgitlab-ce-650f40865e5d8136cb366fbde689c4100aafb0c5.tar.gz
Forbid the use of `#reload` and prefer `#reset`forbid-the-usage-of-reload
The `#reload` makes to load all objects into memory, and the main purpose of `#reload` is to drop the association cache. The `#reset` seems to solve exactly that case.
Diffstat (limited to 'app/services/groups/destroy_service.rb')
-rw-r--r--app/services/groups/destroy_service.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/services/groups/destroy_service.rb b/app/services/groups/destroy_service.rb
index 641111aeadc..654fe84e3dc 100644
--- a/app/services/groups/destroy_service.rb
+++ b/app/services/groups/destroy_service.rb
@@ -20,7 +20,7 @@ module Groups
end
# reload the relation to prevent triggering destroy hooks on the projects again
- group.projects.reload
+ group.projects.reset
group.children.each do |group|
# This needs to be synchronous since the namespace gets destroyed below