cheap_ams 0.10.6 → 0.10.7
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45f1d5d54eeb6d04d577524cd588cf78ae4e9793
|
4
|
+
data.tar.gz: d8b202d9e2a3dd870b9e83ca3a6d2dfd3790b01e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe78167707680e9a2da8fe8cc84d26ca4858b671444b1df648b11522839ec20bea241cd432df815d88aaf13fbab01661cd47f02b2437014713c74aa5f7a78507
|
7
|
+
data.tar.gz: 96e5830115fcb6aa3e6605f260f67b0ba3036b90ab00434f34bc4a4aa85d55196394fce56a4bb1e39aa27685df3040e1a63f77af2f6f2cfe3e514f13b531dd69
|
@@ -23,6 +23,8 @@ module ActiveModel
|
|
23
23
|
private
|
24
24
|
|
25
25
|
def pages_from
|
26
|
+
return {} if collection.total_pages == FIRST_PAGE
|
27
|
+
|
26
28
|
{}.tap do |pages|
|
27
29
|
pages[:self] = collection.current_page
|
28
30
|
|
@@ -33,8 +35,8 @@ module ActiveModel
|
|
33
35
|
|
34
36
|
unless collection.current_page == collection.total_pages
|
35
37
|
pages[:next] = collection.current_page + FIRST_PAGE
|
38
|
+
pages[:last] = collection.total_pages
|
36
39
|
end
|
37
|
-
pages[:last] = collection.total_pages
|
38
40
|
end
|
39
41
|
end
|
40
42
|
|
@@ -158,7 +158,7 @@ module ActiveModel
|
|
158
158
|
def add_links(options)
|
159
159
|
links = @hash.fetch(:meta) { {} }
|
160
160
|
collection = serializer.object
|
161
|
-
@hash[:meta] = add_pagination_links(links, collection, options) if is_paginated?(
|
161
|
+
@hash[:meta] = add_pagination_links(links, collection, options) if is_paginated?(collection)
|
162
162
|
end
|
163
163
|
|
164
164
|
def add_pagination_links(links, collection, options)
|