summaryrefslogtreecommitdiffstats
path: root/app/models/project.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-05-18 16:15:22 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-05-18 16:15:22 +0000
commit073818f8bc46580e118a7550f1faaa55b3be13d9 (patch)
tree6ea9ab7a218ecdac7f4fba61f339e17d0459f04d /app/models/project.rb
parent1907c31138d065aea93f53b8e7565e06a44e49f8 (diff)
downloadredmine-073818f8bc46580e118a7550f1faaa55b3be13d9.tar.gz
redmine-073818f8bc46580e118a7550f1faaa55b3be13d9.zip
Ability to search all projects or the projects the user belongs to (#791).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1435 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/project.rb')
-rw-r--r--app/models/project.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 8c32c8562..2f2937fd9 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -46,7 +46,7 @@ class Project < ActiveRecord::Base
acts_as_tree :order => "name", :counter_cache => true
- acts_as_searchable :columns => ['name', 'description'], :project_key => 'id'
+ acts_as_searchable :columns => ['name', 'description'], :project_key => 'id', :permission => nil
acts_as_event :title => Proc.new {|o| "#{l(:label_project)}: #{o.name}"},
:url => Proc.new {|o| {:controller => 'projects', :action => 'show', :id => o.id}}
@@ -202,6 +202,10 @@ class Project < ActiveRecord::Base
@all_custom_fields ||= (IssueCustomField.for_all + custom_fields).uniq
end
+ def project
+ self
+ end
+
def <=>(project)
name.downcase <=> project.name.downcase
end