summaryrefslogtreecommitdiffstats
path: root/app/models/issue_query.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-01-03 12:28:50 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-01-03 12:28:50 +0000
commitd82159bcf544bb66e301599ae0cada1ce73f2335 (patch)
treec15e3ebbcdd217b94ec4f668e69ceb041990154e /app/models/issue_query.rb
parent049eaeb776b51710a1a2efe061a0850626445938 (diff)
downloadredmine-d82159bcf544bb66e301599ae0cada1ce73f2335.tar.gz
redmine-d82159bcf544bb66e301599ae0cada1ce73f2335.zip
Use joins instead of sub-queries in group by/sort by when using custom fields (#12713).
Sub-queries in group by are not supported by SQLServer. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11102 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/issue_query.rb')
-rw-r--r--app/models/issue_query.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/issue_query.rb b/app/models/issue_query.rb
index 84eb3cf6a..8f7002ad0 100644
--- a/app/models/issue_query.rb
+++ b/app/models/issue_query.rb
@@ -253,7 +253,7 @@ class IssueQuery < Query
if grouped?
begin
# Rails3 will raise an (unexpected) RecordNotFound if there's only a nil group value
- r = Issue.visible.count(:group => group_by_statement, :include => [:status, :project], :conditions => statement)
+ r = Issue.visible.count(:joins => joins_for_order_statement(group_by_statement), :group => group_by_statement, :include => [:status, :project], :conditions => statement)
rescue ActiveRecord::RecordNotFound
r = {nil => issue_count}
end