active_model_serializers_contrib 0.1.0 → 0.1.1

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: 70f7d6ef1d380cc286dea11ef8d61796e4bb67f6
4
- data.tar.gz: dd4e99c972c9ff6952a816c1c650ff562fa6f2ca
3
+ metadata.gz: 86100aa15ff79d300172d58b6aec0e69be840e39
4
+ data.tar.gz: d81777c3f4871859133f0c05ec417c094fe14877
5
5
  SHA512:
6
- metadata.gz: 23705fe6aef66f71de558aaf67e1eaebb9605356f6337854e2e66b33f7524f1207beacc1a89cea0be529c35220245ac6b7f4923f15c5c0490520e5fa9d0a2a11
7
- data.tar.gz: efcea6ad9a11ae7c9dbe9ba34fa295da3bfdf8a7b2e2a7e7e5444324997b8acfa2975324f6019608cbf3101f3cf25df9bce65958402edb95daf2ffd42fb79edb
6
+ metadata.gz: 7d39e956a596c649ff9d6b1a8400b9c0717af3fc13afbd7b144f4c7b5cc8130af07459cfc0291e96a3e842e7e79c7a69763153bbbf70ab6438270a9178f7895c
7
+ data.tar.gz: c57a843a2607cf82a599499715f806624c9fc7fa3412d875b77a5c7062f8cfbb9166ca0b977da402923ce1b74123bcaee8c4061ed34eccb736e1451552a88b44
@@ -5,7 +5,7 @@ class ActiveModel::PaginationSerializer < ActiveModel::ArraySerializer
5
5
  offset = object.offset_value
6
6
  current_page = offset ? (offset / per_page) + 1 : 1
7
7
  total_items = object.limit(nil).offset(nil).count
8
- total_pages = per_page ? (total_items / per_page).ceil : 1
8
+ total_pages = per_page ? (total_items / per_page.to_f).ceil : 1
9
9
  prev_page = current_page - 1
10
10
  prev_page = nil if prev_page < 1
11
11
  next_page = current_page + 1
@@ -1,3 +1,3 @@
1
1
  module ActiveModelSerializersContrib
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_model_serializers_contrib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - G5
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-07-03 00:00:00.000000000 Z
12
+ date: 2015-08-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: active_model_serializers
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
158
  version: '0'
159
159
  requirements: []
160
160
  rubyforge_project:
161
- rubygems_version: 2.4.3
161
+ rubygems_version: 2.4.5
162
162
  signing_key:
163
163
  specification_version: 4
164
164
  summary: Modules/classes that extend AMS with more functionality