summaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-01-10 10:09:34 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-01-10 10:09:34 +0000
commit0ed895388b89c1092f88da7c501587b70c4e899e (patch)
tree7e9537ecc7af04355e6e7dc256a892edef75352d /app/models
parent6e94d2f2af616dd3180c1b4eebe35b467198bb2d (diff)
downloadredmine-0ed895388b89c1092f88da7c501587b70c4e899e.tar.gz
redmine-0ed895388b89c1092f88da7c501587b70c4e899e.zip
Option to search open issues only (#10734).
git-svn-id: http://svn.redmine.org/redmine/trunk@13858 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models')
-rw-r--r--app/models/issue.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index e7a444d7d..0f6312f2c 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -47,7 +47,8 @@ class Issue < ActiveRecord::Base
acts_as_customizable
acts_as_watchable
acts_as_searchable :columns => ['subject', "#{table_name}.description"],
- :preload => [:project, :status, :tracker]
+ :preload => [:project, :status, :tracker],
+ :scope => lambda {|options| options[:open_issues] ? self.open : self.all}
acts_as_event :title => Proc.new {|o| "#{o.tracker.name} ##{o.id} (#{o.status}): #{o.subject}"},
:url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o.id}},