summaryrefslogtreecommitdiffstats
path: root/app/helpers/versions_helper.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-05-10 10:10:37 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-05-10 10:10:37 +0000
commit92833d0b10e7c46477e1485a4bf616649aee544e (patch)
tree3f39f507971400b9bc7be421d34f36b0b0c33c9c /app/helpers/versions_helper.rb
parentd640f7b249b92fe98eff5727bc635a6fd65598bd (diff)
downloadredmine-92833d0b10e7c46477e1485a4bf616649aee544e.tar.gz
redmine-92833d0b10e7c46477e1485a4bf616649aee544e.zip
Use #fixed_issues association (#19455).
Patch by Sebastian Paluch. git-svn-id: http://svn.redmine.org/redmine/trunk@14263 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/versions_helper.rb')
-rw-r--r--app/helpers/versions_helper.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/helpers/versions_helper.rb b/app/helpers/versions_helper.rb
index 2271471b4..043ba276c 100644
--- a/app/helpers/versions_helper.rb
+++ b/app/helpers/versions_helper.rb
@@ -57,9 +57,9 @@ module VersionsHelper
h = Hash.new {|k,v| k[v] = [0, 0]}
begin
# Total issue count
- Issue.where(:fixed_version_id => version.id).group(criteria).count.each {|c,s| h[c][0] = s}
+ version.fixed_issues.group(criteria).count.each {|c,s| h[c][0] = s}
# Open issues count
- Issue.open.where(:fixed_version_id => version.id).group(criteria).count.each {|c,s| h[c][1] = s}
+ version.fixed_issues.open.group(criteria).count.each {|c,s| h[c][1] = s}
rescue ActiveRecord::RecordNotFound
# When grouping by an association, Rails throws this exception if there's no result (bug)
end