summaryrefslogtreecommitdiffstats
path: root/app/models/news.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-12-12 20:49:31 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-12-12 20:49:31 +0000
commit2fe806a4a49cc3fcd7c2b7fe3a385d3a46ffbfd5 (patch)
tree82f8da72bfdc6e68c83cbecf3ffac2b5bcc9738a /app/models/news.rb
parent963719042a12e7833a95396036a662237a7939a0 (diff)
downloadredmine-2fe806a4a49cc3fcd7c2b7fe3a385d3a46ffbfd5.tar.gz
redmine-2fe806a4a49cc3fcd7c2b7fe3a385d3a46ffbfd5.zip
Rewrites search engine to properly paginate results (#18631).
Instead of counting and retrieving results based on their timestamps, we now load all result ids then load the appropriate results by their ids. This also brings a 2x performance improvement as we search tokens in one of the 2 queries only. git-svn-id: http://svn.redmine.org/redmine/trunk@13739 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/news.rb')
-rw-r--r--app/models/news.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/news.rb b/app/models/news.rb
index 6ade4f4f1..046bb8137 100644
--- a/app/models/news.rb
+++ b/app/models/news.rb
@@ -29,7 +29,7 @@ class News < ActiveRecord::Base
acts_as_attachable :edit_permission => :manage_news,
:delete_permission => :manage_news
acts_as_searchable :columns => ['title', 'summary', "#{table_name}.description"],
- :scope => preload(:project)
+ :preload => :project
acts_as_event :url => Proc.new {|o| {:controller => 'news', :action => 'show', :id => o.id}}
acts_as_activity_provider :scope => preload(:project, :author),
:author_key => :author_id