Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeinrich Lee Yu <hleeyu@gmail.com>2018-12-21 14:44:37 +0300
committerHeinrich Lee Yu <hleeyu@gmail.com>2019-01-03 20:59:41 +0300
commit40f31486a8397c9142a0d5d0434b02d578aa8a67 (patch)
tree87e8684e20df494d5b555875166c77de8298b08b /app/helpers
parent725cd1367f8579e6c054c6cd2df42b934abfdc16 (diff)
Reduce counts in search_entries_info
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/search_helper.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb
index 80cc568820a..0ee76a51f7d 100644
--- a/app/helpers/search_helper.rb
+++ b/app/helpers/search_helper.rb
@@ -24,10 +24,10 @@ module SearchHelper
end
def search_entries_info(collection, scope, term)
- return unless collection.count > 0
+ return if collection.to_a.empty?
from = collection.offset_value + 1
- to = collection.offset_value + collection.count
+ to = collection.offset_value + collection.to_a.size
count = collection.total_count
"Showing #{from} - #{to} of #{count} #{scope.humanize(capitalize: false)} for \"#{term}\""