Remove join in backlogs filter

pull/7754/head
Oliver Günther 5 years ago
parent 9047a23d5d
commit 777f3141f7
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 4
      modules/backlogs/lib/open_project/backlogs/work_package_filter.rb

@ -153,12 +153,12 @@ module OpenProject::Backlogs
end
def blocks_backlogs_type_sql
all_types = (Story.types + [Task.type]).map(&:to_s).join(',')
all_types = (Story.types + [Task.type]).map(&:to_s)
Relation
.blocks
.joins(:to)
.where(work_packages: { type_id: all_types } )
.where(work_packages: { type_id: all_types })
.select(:to_id)
.to_sql
end

Loading…
Cancel
Save