1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-01-31 19:47:14 +00:00

Use base_scope for issue query results (#35396).

Patch by Alexander Meindl.


git-svn-id: http://svn.redmine.org/redmine/trunk@21040 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA 2021-06-19 02:16:38 +00:00
parent 0e25b4ebdc
commit ffc9101e23

View File

@ -359,10 +359,8 @@ class IssueQuery < Query
order_option << "#{Issue.table_name}.id DESC"
end
scope = Issue.visible.
joins(:status, :project).
scope = base_scope.
preload(:priority).
where(statement).
includes(([:status, :project] + (options[:include] || [])).uniq).
where(options[:conditions]).
order(order_option).
@ -409,9 +407,7 @@ class IssueQuery < Query
order_option << "#{Issue.table_name}.id DESC"
end
Issue.visible.
joins(:status, :project).
where(statement).
base_scope.
includes(([:status, :project] + (options[:include] || [])).uniq).
references(([:status, :project] + (options[:include] || [])).uniq).
where(options[:conditions]).