diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-07-20 17:26:07 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-07-20 17:26:07 +0000 |
commit | be2b8a62f4d0d8bf413a5583fe644bd41a8ebf04 (patch) | |
tree | 95fe7f273935739e1ffa82be16cee93927a4c054 /app/models | |
parent | 83baccb71ac0e609ce72ebf322f73884548a9ba5 (diff) | |
download | redmine-be2b8a62f4d0d8bf413a5583fe644bd41a8ebf04.tar.gz redmine-be2b8a62f4d0d8bf413a5583fe644bd41a8ebf04.zip |
Search engine: display total results count (#906) and count by result type.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1681 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/issue.rb | 5 | ||||
-rw-r--r-- | app/models/journal.rb | 6 |
2 files changed, 4 insertions, 7 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index b19e64883..cae603dd8 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -35,7 +35,10 @@ class Issue < ActiveRecord::Base acts_as_customizable acts_as_watchable - acts_as_searchable :columns => ['subject', "#{table_name}.description"], :include => :project, :with => {:journal => :issue} + acts_as_searchable :columns => ['subject', "#{table_name}.description", "#{Journal.table_name}.notes"], + :include => [:project, :journals], + # sort by id so that limited eager loading doesn't break with postgresql + :order_column => "#{table_name}.id" acts_as_event :title => Proc.new {|o| "#{o.tracker.name} ##{o.id}: #{o.subject}"}, :url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o.id}} diff --git a/app/models/journal.rb b/app/models/journal.rb index 8583f63de..a427f84e3 100644 --- a/app/models/journal.rb +++ b/app/models/journal.rb @@ -25,12 +25,6 @@ class Journal < ActiveRecord::Base has_many :details, :class_name => "JournalDetail", :dependent => :delete_all attr_accessor :indice - acts_as_searchable :columns => 'notes', - :include => {:issue => :project}, - :project_key => "#{Issue.table_name}.project_id", - :date_column => "#{Issue.table_name}.created_on", - :permission => :view_issues - acts_as_event :title => Proc.new {|o| status = ((s = o.new_status) ? " (#{s})" : nil); "#{o.issue.tracker} ##{o.issue.id}#{status}: #{o.issue.subject}" }, :description => :notes, :author => :user, |