search is broken on redmine3 #370

This commit is contained in:
Karel Pičman 2015-03-31 12:06:48 +02:00
parent 1886003ef7
commit ea2e3f7676
2 changed files with 9 additions and 0 deletions

View File

@ -422,6 +422,11 @@ class DmsfFile < ActiveRecord::Base
[results, results_count]
end
def self.search_result_ranks_and_ids(tokens, user = User.current, projects = nil, options = {})
r = self.search(tokens, projects, options)[0]
r.each_index { |x| [x, r[1][x]] }
end
def display_name
if self.name.length > 50

View File

@ -318,6 +318,10 @@ class DmsfFolder < ActiveRecord::Base
[results, results_count]
end
def self.search_result_ranks_and_ids(tokens, user = User.current, projects = nil, options = {})
self.search(tokens, :user => user, :projects => projects, :options => options)
end
def modified
last_update = updated_at