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/controllers/projects_controller.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/controllers/projects_controller.rb')
-rw-r--r-- | app/controllers/projects_controller.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 62b97fc2590..48f4d7a586d 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -237,7 +237,7 @@ class ProjectsController < Projects::ApplicationController def toggle_star current_user.toggle_star(@project) - @project.reload + @project.reset render json: { star_count: @project.star_count |