diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-12-18 13:05:46 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-12-18 13:05:46 +0000 |
commit | 2a0257e8af822b1e3022479b213ca4bf7d0ef903 (patch) | |
tree | d2031022eda4a73bcb58cbc5fc93a04fac858da8 /app/models/version.rb | |
parent | 76ad136b2a46e626f398872a71fa04fa4ad29743 (diff) | |
download | redmine-2a0257e8af822b1e3022479b213ca4bf7d0ef903.tar.gz redmine-2a0257e8af822b1e3022479b213ca4bf7d0ef903.zip |
Use open scope in version issues count methods.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8285 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/version.rb')
-rw-r--r-- | app/models/version.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/version.rb b/app/models/version.rb index 3340be77e..8002ac9c8 100644 --- a/app/models/version.rb +++ b/app/models/version.rb @@ -124,12 +124,12 @@ class Version < ActiveRecord::Base # Returns the total amount of open issues for this version. def open_issues_count - @open_issues_count ||= Issue.count(:all, :conditions => ["fixed_version_id = ? AND is_closed = ?", self.id, false], :include => :status) + @open_issues_count ||= Issue.open.count(:all, :conditions => ["fixed_version_id = ?", self.id]) end # Returns the total amount of closed issues for this version. def closed_issues_count - @closed_issues_count ||= Issue.count(:all, :conditions => ["fixed_version_id = ? AND is_closed = ?", self.id, true], :include => :status) + @closed_issues_count ||= Issue.open(false).count(:all, :conditions => ["fixed_version_id = ?", self.id]) end def wiki_page |