-
- Downloads
Improve checking if projects would be returned
In various places we check if the same relation would return projects. This is done using "any?" which will run a COUNT query with any LIMIT/OFFSET values still applied. To work around all this we introduce 2 helper methods that take care of doing the right thing. This leads to the produced queries being simpler and fewer queries being executed.
Showing
- app/helpers/projects_helper.rb 20 additions, 0 deletionsapp/helpers/projects_helper.rb
- app/views/dashboard/projects/index.html.haml 1 addition, 3 deletionsapp/views/dashboard/projects/index.html.haml
- app/views/dashboard/projects/starred.html.haml 1 addition, 1 deletionapp/views/dashboard/projects/starred.html.haml
- app/views/shared/_new_project_item_select.html.haml 1 addition, 1 deletionapp/views/shared/_new_project_item_select.html.haml
- app/views/shared/projects/_list.html.haml 1 addition, 1 deletionapp/views/shared/projects/_list.html.haml
- changelogs/unreleased/dont-use-limit-offset-when-counting-projects.yml 4 additions, 0 deletions...released/dont-use-limit-offset-when-counting-projects.yml
- spec/helpers/projects_helper_spec.rb 44 additions, 0 deletionsspec/helpers/projects_helper_spec.rb
Please register or sign in to comment