summaryrefslogtreecommitdiffstats
path: root/lib/plugins
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-02 20:42:58 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-02 20:42:58 +0000
commit5cb56fd1e4230dd8a199adab98565b9dc3bb9596 (patch)
treee634bf22c68fda00de034ecf9a23c7334b3bbb78 /lib/plugins
parent282a13d6eea3aa8c6530bdf14cdd86229b095e30 (diff)
downloadredmine-5cb56fd1e4230dd8a199adab98565b9dc3bb9596.tar.gz
redmine-5cb56fd1e4230dd8a199adab98565b9dc3bb9596.zip
Replaces find(:all) calls.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10920 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/plugins')
-rw-r--r--lib/plugins/acts_as_searchable/lib/acts_as_searchable.rb5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/plugins/acts_as_searchable/lib/acts_as_searchable.rb b/lib/plugins/acts_as_searchable/lib/acts_as_searchable.rb
index ff9d2d507..fe0f8518e 100644
--- a/lib/plugins/acts_as_searchable/lib/acts_as_searchable.rb
+++ b/lib/plugins/acts_as_searchable/lib/acts_as_searchable.rb
@@ -87,10 +87,7 @@ module Redmine
token_clauses = columns.collect {|column| "(LOWER(#{column}) LIKE ?)"}
if !options[:titles_only] && searchable_options[:search_custom_fields]
- searchable_custom_field_ids = CustomField.find(:all,
- :select => 'id',
- :conditions => { :type => "#{self.name}CustomField",
- :searchable => true }).collect(&:id)
+ searchable_custom_field_ids = CustomField.where(:type => "#{self.name}CustomField", :searchable => true).pluck(:id)
if searchable_custom_field_ids.any?
custom_field_sql = "#{table_name}.id IN (SELECT customized_id FROM #{CustomValue.table_name}" +
" WHERE customized_type='#{self.name}' AND customized_id=#{table_name}.id AND LOWER(value) LIKE ?" +