summaryrefslogtreecommitdiffstats
path: root/app/models/document.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-09-27 17:28:22 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-09-27 17:28:22 +0000
commita96421019f3a813b93798e4ec8099edd09f8a661 (patch)
tree102827aea563063b29ae21800bfff88fb16550f9 /app/models/document.rb
parentd723bea502faedb218f929b40849935d61c577e2 (diff)
downloadredmine-a96421019f3a813b93798e4ec8099edd09f8a661.tar.gz
redmine-a96421019f3a813b93798e4ec8099edd09f8a661.zip
Search engines now supports pagination.
Results are sorted in reverse chronological order. git-svn-id: http://redmine.rubyforge.org/svn/trunk@766 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/document.rb')
-rw-r--r--app/models/document.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/document.rb b/app/models/document.rb
index 6989191ce..d95427ee6 100644
--- a/app/models/document.rb
+++ b/app/models/document.rb
@@ -20,7 +20,9 @@ class Document < ActiveRecord::Base
belongs_to :category, :class_name => "Enumeration", :foreign_key => "category_id"
has_many :attachments, :as => :container, :dependent => :destroy
- acts_as_event :url => Proc.new {|o| {:controller => 'documents', :action => 'show', :id => o.id}}
+ acts_as_searchable :columns => ['title', 'description']
+ acts_as_event :title => Proc.new {|o| "#{l(:label_document)}: #{o.title}"},
+ :url => Proc.new {|o| {:controller => 'documents', :action => 'show', :id => o.id}}
validates_presence_of :project, :title, :category
validates_length_of :title, :maximum => 60