mirror of
https://github.com/redmine/redmine.git
synced 2025-10-26 07:46:17 +01:00
Replace multiple projects.status <> ... conditions with projects.status IN (...) for optimizer-friendliness in Project.allowed_to_condition (#43214).
Patch by Go MAEDA (user:maeda). git-svn-id: https://svn.redmine.org/redmine/trunk@23979 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -186,7 +186,7 @@ class Project < ApplicationRecord
|
||||
perm = Redmine::AccessControl.permission(permission)
|
||||
base_statement =
|
||||
if perm && perm.read?
|
||||
"#{Project.table_name}.status <> #{Project::STATUS_ARCHIVED} AND #{Project.table_name}.status <> #{Project::STATUS_SCHEDULED_FOR_DELETION}"
|
||||
"#{Project.table_name}.status IN (#{Project::STATUS_ACTIVE}, #{Project::STATUS_CLOSED})"
|
||||
else
|
||||
"#{Project.table_name}.status = #{Project::STATUS_ACTIVE}"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user