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
This commit is contained in:
Jean-Philippe Lang
2007-09-27 17:28:22 +00:00
parent d723bea502
commit a96421019f
22 changed files with 178 additions and 58 deletions
+5
View File
@@ -22,6 +22,11 @@ class Message < ActiveRecord::Base
has_many :attachments, :as => :container, :dependent => :destroy
belongs_to :last_reply, :class_name => 'Message', :foreign_key => 'last_reply_id'
acts_as_searchable :columns => ['subject', 'content'], :include => :board, :project_key => "project_id"
acts_as_event :title => Proc.new {|o| "#{o.board.name}: #{o.subject}"},
:description => :content,
:url => Proc.new {|o| {:controller => 'messages', :action => 'show', :board_id => o.board_id, :id => o.id}}
validates_presence_of :subject, :content
validates_length_of :subject, :maximum => 255