Patch #33431 » time_query_performace_v2.patch
| app/models/time_entry_query.rb | ||
|---|---|---|
|
def base_scope
|
||
|
TimeEntry.visible.
|
||
|
joins(:project, :user).
|
||
|
includes(:activity).
|
||
|
references(:activity).
|
||
|
left_join_issue.
|
||
|
where(statement)
|
||
|
end
|
||
| ... | ... | |
|
order_option << "#{TimeEntry.table_name}.id ASC"
|
||
|
base_scope.
|
||
|
includes(:activity).
|
||
|
references(:activity).
|
||
|
where("#{Enumeration.table_name}.project_id = #{TimeEntry.table_name}.project_id").
|
||
|
order(order_option).
|
||
|
joins(joins_for_order_statement(order_option.join(',')))
|
||
|
end
|
||