@@ -64,7 +64,7 module Redmine | |||||
64 | # Searches the model for the given tokens and user visibility. |
|
64 | # Searches the model for the given tokens and user visibility. | |
65 | # The projects argument can be either nil (will search all projects), a project or an array of projects. |
|
65 | # The projects argument can be either nil (will search all projects), a project or an array of projects. | |
66 | # Returns an array that contains the rank and id of all results. |
|
66 | # Returns an array that contains the rank and id of all results. | |
67 | # In current implementation, the rank is the record timestamp. |
|
67 | # In current implementation, the rank is the record timestamp converted as an integer. | |
68 | # |
|
68 | # | |
69 | # Valid options: |
|
69 | # Valid options: | |
70 | # * :titles_only - searches tokens in the first searchable column only |
|
70 | # * :titles_only - searches tokens in the first searchable column only | |
@@ -73,7 +73,7 module Redmine | |||||
73 | # |
|
73 | # | |
74 | # Example: |
|
74 | # Example: | |
75 | # Issue.search_result_ranks_and_ids("foo") |
|
75 | # Issue.search_result_ranks_and_ids("foo") | |
76 | # # => [[Tue, 26 Jun 2007 22:16:00 UTC +00:00, 69], [Mon, 08 Oct 2007 14:31:00 UTC +00:00, 123]] |
|
76 | # # => [[1419595329, 69], [1419595622, 123]] | |
77 | def search_result_ranks_and_ids(tokens, user=User.current, projects=nil, options={}) |
|
77 | def search_result_ranks_and_ids(tokens, user=User.current, projects=nil, options={}) | |
78 | if projects.is_a?(Array) && projects.empty? |
|
78 | if projects.is_a?(Array) && projects.empty? | |
79 | # no results |
|
79 | # no results |
General Comments 0
You need to be logged in to leave comments.
Login now