Merge pull request #5001 from opf/fix/remove_problematic_distinct

remove problematic distinct
pull/5005/head
Oliver Günther 8 years ago committed by GitHub
commit 41c3af1a05
  1. 4
      app/models/query/results.rb

@ -87,8 +87,12 @@ class ::Query::Results
includes = ([:status, :project] +
includes_for_columns(query.involved_columns) + (options[:include] || [])).uniq
# A 'distinct' is added by the visible scope which is not necessary for
# filtering the work packages and which might conflict with ordering in
# mysql.
WorkPackage
.visible
.distinct(false)
.where(::Query.merge_conditions(query.statement, options[:conditions]))
.includes(includes)
.joins((query.group_by_column ? query.group_by_column.join : nil))

Loading…
Cancel
Save