|
|
@ -117,15 +117,14 @@ module Redmine |
|
|
|
.references(searchable_options[:references]) |
|
|
|
.references(searchable_options[:references]) |
|
|
|
.order(find_order) |
|
|
|
.order(find_order) |
|
|
|
.scoping do |
|
|
|
.scoping do |
|
|
|
|
|
|
|
results_count = count |
|
|
|
|
|
|
|
results = all |
|
|
|
|
|
|
|
|
|
|
|
results_count = count |
|
|
|
if options[:offset] |
|
|
|
results = all |
|
|
|
results = results.where("(#{searchable_options[:date_column]} " + (options[:before] ? '<' : '>') + "'#{connection.quoted_date(options[:offset])}')") |
|
|
|
|
|
|
|
end |
|
|
|
if options[:offset] |
|
|
|
results = results.limit(options[:limit]) if options[:limit] |
|
|
|
results = results.where("(#{searchable_options[:date_column]} " + (options[:before] ? '<' : '>') + "'#{connection.quoted_date(options[:offset])}')") |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
results = results.limit(options[:limit]) if options[:limit] |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
[results, results_count] |
|
|
|
[results, results_count] |
|
|
|
end |
|
|
|
end |
|
|
|