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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86100aa15ff79d300172d58b6aec0e69be840e39
|
4
|
+
data.tar.gz: d81777c3f4871859133f0c05ec417c094fe14877
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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.
|
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-
|
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.
|
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
|