join status explicitly triggered by status filter

pull/10421/head
ulferts 3 years ago committed by Oliver Günther
parent 52c98687ad
commit 3b0b0a93b2
  1. 4
      app/models/queries/work_packages/filter/status_filter.rb
  2. 6
      app/models/query/results.rb

@ -65,6 +65,10 @@ class Queries::WorkPackages::Filter::StatusFilter < Queries::WorkPackages::Filte
true
end
def joins
:status
end
private
def all_statuses

@ -41,9 +41,9 @@ class ::Query::Results
def work_package_count
work_package_scope
.joins(all_filter_joins)
.includes(:status, :project)
.includes(:project)
.where(query.statement)
.references(:statuses, :projects)
.references(:projects)
.count
rescue ::ActiveRecord::StatementInvalid => e
raise ::Query::StatementInvalid.new(e.message)
@ -79,7 +79,7 @@ class ::Query::Results
end
def all_includes
(%i(status project) +
(%i(project) +
includes_for_columns(include_columns)).uniq
end

Loading…
Cancel
Save