diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2019-04-08 16:33:36 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2019-04-15 14:05:14 +0300 |
commit | 650f40865e5d8136cb366fbde689c4100aafb0c5 (patch) | |
tree | f740d9f235693ad8e2a3693d6ec30dee26d2a74a /app/services/projects/move_project_group_links_service.rb | |
parent | 7457c1e1229cd1e90e608e8b247e2fbb217f05b6 (diff) |
Forbid the use of `#reload` and prefer `#reset`
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/projects/move_project_group_links_service.rb')
-rw-r--r-- | app/services/projects/move_project_group_links_service.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/services/projects/move_project_group_links_service.rb b/app/services/projects/move_project_group_links_service.rb index 36afcd0c503..cf4b291c761 100644 --- a/app/services/projects/move_project_group_links_service.rb +++ b/app/services/projects/move_project_group_links_service.rb @@ -26,7 +26,7 @@ module Projects # Remove remaining project group links from source_project def remove_remaining_project_group_links - source_project.reload.project_group_links.destroy_all # rubocop: disable DestroyAll + source_project.reset.project_group_links.destroy_all # rubocop: disable DestroyAll end def group_links_in_target_project |