summaryrefslogtreecommitdiffstats
path: root/app/models/document.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/document.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/document.rb')
-rw-r--r--app/models/document.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/document.rb b/app/models/document.rb
index 7a432b46b..9e2818fc7 100644
--- a/app/models/document.rb
+++ b/app/models/document.rb
@@ -20,7 +20,7 @@ class Document < ActiveRecord::Base
belongs_to :category, :class_name => "Enumeration", :foreign_key => "category_id"
has_many :attachments, :as => :container, :dependent => :destroy
- acts_as_searchable :columns => ['title', 'description']
+ acts_as_searchable :columns => ['title', "#{table_name}.description"], :include => :project
acts_as_event :title => Proc.new {|o| "#{l(:label_document)}: #{o.title}"},
:author => Proc.new {|o| (a = o.attachments.find(:first, :order => "#{Attachment.table_name}.created_on ASC")) ? a.author : nil },
:url => Proc.new {|o| {:controller => 'documents', :action => 'show', :id => o.id}}