jsonapi.rb 1.5.0 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/jsonapi/pagination.rb +2 -2
- data/lib/jsonapi/version.rb +1 -1
- 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: e8ab954fc5d38b6dca31a478d98b73fb98927221
|
4
|
+
data.tar.gz: 5b3f497a7eabdf96f487f2101f8b5b6783692a03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a7d7d8c51e68f657273c5b4cb4e8441f9f53eddc0c928c2974bc5c0603339cc680e8b5dd0648930dbcc0af0ef9f30673d3f84b994c3a507a590f7a0a5d139e3
|
7
|
+
data.tar.gz: f2a57cd3c285eb074bc0a05f01e94f510e10eafc0b90f5d1fbdbfca80df86882490145e986b12f6ea29cdf30d4b799ce39dce3f867dd7601a661d82b4274e348
|
data/Gemfile.lock
CHANGED
data/lib/jsonapi/pagination.rb
CHANGED
@@ -87,8 +87,8 @@ module JSONAPI
|
|
87
87
|
def_per_page = self.class.const_get(:JSONAPI_PAGE_SIZE).to_i
|
88
88
|
|
89
89
|
pagination = params[:page].try(:slice, :number, :size) || {}
|
90
|
-
per_page =
|
91
|
-
per_page = def_per_page if per_page > def_per_page
|
90
|
+
per_page = pagination[:size].to_f.to_i
|
91
|
+
per_page = def_per_page if per_page > def_per_page || per_page < 1
|
92
92
|
num = [1, pagination[:number].to_f.to_i].max
|
93
93
|
|
94
94
|
[(num - 1) * per_page, per_page, num]
|
data/lib/jsonapi/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsonapi.rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stas Suscov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fast_jsonapi
|