diff options
Diffstat (limited to 'app/models/document.rb')
-rw-r--r-- | app/models/document.rb | 4 |
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 |