mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-29 19:51:01 +08:00
Improve speed of index query in projects overview service [SCI-3107]
This commit is contained in:
parent
e0ef3781a8
commit
1fedb4c91e
1 changed files with 1 additions and 0 deletions
|
@ -72,6 +72,7 @@ class ProjectsOverviewService
|
||||||
.joins('LEFT OUTER JOIN user_projects ON '\
|
.joins('LEFT OUTER JOIN user_projects ON '\
|
||||||
'user_projects.project_id = projects.id')
|
'user_projects.project_id = projects.id')
|
||||||
.left_outer_joins(:user_my_modules)
|
.left_outer_joins(:user_my_modules)
|
||||||
|
.where('projects.id': @team.projects)
|
||||||
.where('user_my_modules.user_id = :user_id '\
|
.where('user_my_modules.user_id = :user_id '\
|
||||||
'OR (user_projects.role = 0 '\
|
'OR (user_projects.role = 0 '\
|
||||||
'AND user_projects.user_id = :user_id)', user_id: @user.id)
|
'AND user_projects.user_id = :user_id)', user_id: @user.id)
|
||||||
|
|
Loading…
Reference in a new issue