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: bacc6451ac77d1740a76023d37025b72e83dc758
4
- data.tar.gz: 4c34c52e8871b663c994862f13eb1d6dfd459f51
3
+ metadata.gz: 45f1d5d54eeb6d04d577524cd588cf78ae4e9793
4
+ data.tar.gz: d8b202d9e2a3dd870b9e83ca3a6d2dfd3790b01e
5
5
  SHA512:
6
- metadata.gz: 21b1ac7c84fc65eb0122bcd001797e78bd6bf1ca7e6a5f851ff464a9b2472024ddff2ac6fb9ec623d2f064f719e07bb5a8cfab8d2d5e91b3a235b4a5991d1539
7
- data.tar.gz: 5a9abdae7b843688e75db24c2b1428b9a927a83758237b8f8499e7640faf8ed86982bfb07630a911dd2fae06d3f6d83ab7de0bdff8cf4f4886e7395f9076ec02
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?(resources)
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)
@@ -1,5 +1,5 @@
1
1
  module ActiveModel
2
2
  class Serializer
3
- VERSION = "0.10.6"
3
+ VERSION = "0.10.7"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cheap_ams
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.6
4
+ version: 0.10.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Klabnik