api-pagination 4.5.1 → 4.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/api-pagination/version.rb +1 -1
- data/lib/grape/pagination.rb +1 -1
- data/lib/rails/pagination.rb +1 -1
- data/spec/rails_spec.rb +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6fb30057d988236c8f5c6e557f7feea70fd79bd5
|
4
|
+
data.tar.gz: 98a0b719a0a1ae299bde47edd30b8a6e2ed015e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b8a65195ac6a5feb65932e020ffa460508f8b53e47b16c34a7c22fd2e3816ffaa7d894590bc14593e3d90991adad14bdd9698a0ac36078588ccea6a35479736
|
7
|
+
data.tar.gz: d29a8fa3d95a922f4be7a880a18f425a32a391e40ae8ebbef46f6c149fcd561153e01bda567e1e5c65edbffd3bf04422e2d68ef6f671efcad2e98e19209c04e8
|
data/lib/grape/pagination.rb
CHANGED
@@ -27,7 +27,7 @@ module Grape
|
|
27
27
|
include_total = ApiPagination.config.include_total
|
28
28
|
|
29
29
|
header 'Link', links.join(', ') unless links.empty?
|
30
|
-
header total_header, ApiPagination.total_from(collection) if include_total
|
30
|
+
header total_header, ApiPagination.total_from(collection).to_s if include_total
|
31
31
|
header per_page_header, options[:per_page].to_s
|
32
32
|
header page_header, options[:page].to_s unless page_header.nil?
|
33
33
|
|
data/lib/rails/pagination.rb
CHANGED
@@ -46,7 +46,7 @@ module Rails
|
|
46
46
|
headers['Link'] = links.join(', ') unless links.empty?
|
47
47
|
headers[per_page_header] = options[:per_page].to_s
|
48
48
|
headers[page_header] = options[:page].to_s unless page_header.nil?
|
49
|
-
headers[total_header] = total_count(collection, options) if include_total
|
49
|
+
headers[total_header] = total_count(collection, options).to_s if include_total
|
50
50
|
|
51
51
|
return collection
|
52
52
|
end
|
data/spec/rails_spec.rb
CHANGED
@@ -212,6 +212,8 @@ describe NumbersController, :type => :controller do
|
|
212
212
|
|
213
213
|
specify do
|
214
214
|
get :index_with_paginate_array_options, params: params
|
215
|
+
|
216
|
+
expect(response.header['Total']).to be_kind_of(String)
|
215
217
|
expect(response.header['Total'].to_i).to eq total_header
|
216
218
|
end
|
217
219
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: api-pagination
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.5.
|
4
|
+
version: 4.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Celis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|