uc3-dmp-api-core 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/uc3-dmp-api-core/paginator.rb +2 -2
- data/lib/uc3-dmp-api-core/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fdf225c15fdb31fde0c5b580c65fe11cc1f954ca5095c3ba65b97ec5a75706c
|
4
|
+
data.tar.gz: 312895d96acf566e198b8159ced5cdf99055330fcddf62b105cfc750fa2d124b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c70e9f61cd6d20b1936561a15257d89d13655eb6d163c28c9cd75f2e1c46927118128155312e6b2e6797d704de6fa5360ea4c2ae3019fd159b8a39d95dc4bc4b
|
7
|
+
data.tar.gz: 7dd073b4a5c47ac0fef2c750bb780282b8b0cdf23fc8243dcbcf64a27b02787ec3dc692d25dbc2c962803f2b5a99f480c2363b62950bfec7d99bb45287a858b5
|
@@ -47,9 +47,9 @@ module Uc3DmpApiCore
|
|
47
47
|
# Fetch the current :page and :per_page from the params or use the defaults
|
48
48
|
def _current_page(item_count: 0, params: {})
|
49
49
|
page = params.fetch('page', DEFAULT_PAGE)
|
50
|
-
page = DEFAULT_PAGE if page <= 1
|
50
|
+
page = DEFAULT_PAGE if page.nil? || page <= 1
|
51
51
|
per_page = params.fetch('per_page', DEFAULT_PER_PAGE)
|
52
|
-
per_page = DEFAULT_PER_PAGE if per_page >= MAXIMUM_PER_PAGE || per_page < 1
|
52
|
+
per_page = DEFAULT_PER_PAGE if per_page.nil? || per_page >= MAXIMUM_PER_PAGE || per_page < 1
|
53
53
|
|
54
54
|
total_pages = _page_count(total: item_count, per_page: per_page)
|
55
55
|
page = total_pages if page > total_pages
|