Commit 8138e3f2 authored by marutosijp's avatar marutosijp
Browse files

remove empty lines with trailing white spaces at lib/redmine/search.rb


git-svn-id: https://svn.redmine.org/redmine/trunk@16941 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 234e9205
...@@ -82,13 +82,11 @@ module Redmine ...@@ -82,13 +82,11 @@ module Redmine
# Returns the results for the given offset and limit # Returns the results for the given offset and limit
def results(offset, limit) def results(offset, limit)
result_ids_to_load = result_ids[offset, limit] || [] result_ids_to_load = result_ids[offset, limit] || []
results_by_scope = Hash.new {|h,k| h[k] = []} results_by_scope = Hash.new {|h,k| h[k] = []}
result_ids_to_load.group_by(&:first).each do |scope, scope_and_ids| result_ids_to_load.group_by(&:first).each do |scope, scope_and_ids|
klass = scope.singularize.camelcase.constantize klass = scope.singularize.camelcase.constantize
results_by_scope[scope] += klass.search_results_from_ids(scope_and_ids.map(&:last)) results_by_scope[scope] += klass.search_results_from_ids(scope_and_ids.map(&:last))
end end
result_ids_to_load.map do |scope, id| result_ids_to_load.map do |scope, id|
results_by_scope[scope].detect {|record| record.id == id} results_by_scope[scope].detect {|record| record.id == id}
end.compact end.compact
...@@ -110,7 +108,6 @@ module Redmine ...@@ -110,7 +108,6 @@ module Redmine
cache_key = ActiveSupport::Cache.expand_cache_key( cache_key = ActiveSupport::Cache.expand_cache_key(
[@question, @user.id, @scope.sort, @options, project_ids.sort] [@question, @user.id, @scope.sort, @options, project_ids.sort]
) )
Redmine::Search.cache_store.fetch(cache_key, :force => !@cache) do Redmine::Search.cache_store.fetch(cache_key, :force => !@cache) do
load_result_ids load_result_ids
end end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment