summaryrefslogtreecommitdiffstats
path: root/app/models/issue.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-12-18 13:05:46 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-12-18 13:05:46 +0000
commit2a0257e8af822b1e3022479b213ca4bf7d0ef903 (patch)
treed2031022eda4a73bcb58cbc5fc93a04fac858da8 /app/models/issue.rb
parent76ad136b2a46e626f398872a71fa04fa4ad29743 (diff)
downloadredmine-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/issue.rb')
-rw-r--r--app/models/issue.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index be69d929f..199efe119 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -63,7 +63,10 @@ class Issue < ActiveRecord::Base
named_scope :visible, lambda {|*args| { :include => :project,
:conditions => Issue.visible_condition(args.shift || User.current, *args) } }
- named_scope :open, :conditions => ["#{IssueStatus.table_name}.is_closed = ?", false], :include => :status
+ named_scope :open, lambda {|*args|
+ is_closed = args.size > 0 ? !args.first : false
+ {:conditions => ["#{IssueStatus.table_name}.is_closed = ?", is_closed], :include => :status}
+ }
named_scope :recently_updated, :order => "#{Issue.table_name}.updated_on DESC"
named_scope :with_limit, lambda { |limit| { :limit => limit} }