mirror of
https://github.com/redmine/redmine.git
synced 2026-01-21 23:13:04 +01:00
Merged r23609 from trunk to 6.0-stable (#40728).
git-svn-id: https://svn.redmine.org/redmine/branches/6.0-stable@23614 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -164,12 +164,19 @@ class TimeEntryQuery < Query
|
||||
end
|
||||
|
||||
def base_scope
|
||||
TimeEntry.visible.
|
||||
joins(:project, :user).
|
||||
includes(:activity).
|
||||
references(:activity).
|
||||
left_join_issue.
|
||||
where(statement)
|
||||
scope = TimeEntry.visible
|
||||
.joins(:project, :user)
|
||||
.includes(:activity)
|
||||
.references(:activity)
|
||||
.left_join_issue
|
||||
.where(statement)
|
||||
|
||||
if Redmine::Database.mysql? && ActiveRecord::Base.connection.supports_optimizer_hints?
|
||||
# Provides MySQL with a hint to use a better join order and avoid slow response times
|
||||
scope.optimizer_hints('JOIN_ORDER(time_entries, projects, users)')
|
||||
else
|
||||
scope
|
||||
end
|
||||
end
|
||||
|
||||
def results_scope(options={})
|
||||
|
||||
Reference in New Issue
Block a user