active_model_serializers_contrib 0.0.1 → 0.1.0

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: 4dc1940fe8d29c945b3b7facef8477da15865cb4
4
- data.tar.gz: 82a679f7bbc77bfb71725bab349239ff93ca0b4c
3
+ metadata.gz: 70f7d6ef1d380cc286dea11ef8d61796e4bb67f6
4
+ data.tar.gz: dd4e99c972c9ff6952a816c1c650ff562fa6f2ca
5
5
  SHA512:
6
- metadata.gz: 6dbb5a9faefdb983cf7da71a8ade72810a8bd1f3aaa6e8fa605dc4b233f8f1d6c8b2acd7ee2dae3dcb6dbd15704467d9dfbdb71bcce4d4521d89b77be856c6b5
7
- data.tar.gz: 3ee5bc118ddc45d996a7af845409876e1c4d6e9940999b96c323ae359496bf75c8b7802b14f774650289ff4f28fa7a4094efe99deb0c4d39ce486c04f2bfe63c
6
+ metadata.gz: 23705fe6aef66f71de558aaf67e1eaebb9605356f6337854e2e66b33f7524f1207beacc1a89cea0be529c35220245ac6b7f4923f15c5c0490520e5fa9d0a2a11
7
+ data.tar.gz: efcea6ad9a11ae7c9dbe9ba34fa295da3bfdf8a7b2e2a7e7e5444324997b8acfa2975324f6019608cbf3101f3cf25df9bce65958402edb95daf2ffd42fb79edb
@@ -4,8 +4,8 @@ class ActiveModel::PaginationSerializer < ActiveModel::ArraySerializer
4
4
  per_page = object.limit_value
5
5
  offset = object.offset_value
6
6
  current_page = offset ? (offset / per_page) + 1 : 1
7
- total_objects = object.limit(nil).offset(nil).count
8
- total_pages = per_page ? (total_objects / per_page).ceil : 1
7
+ total_items = object.limit(nil).offset(nil).count
8
+ total_pages = per_page ? (total_items / per_page).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
@@ -14,7 +14,7 @@ class ActiveModel::PaginationSerializer < ActiveModel::ArraySerializer
14
14
  opts[:meta] ||= {}
15
15
  opts[:meta][:current_page] = current_page
16
16
  opts[:meta][:total_pages] = total_pages
17
- opts[:meta][:total] = total_objects
17
+ opts[:meta][:total_items] = total_items
18
18
  opts[:meta][:prev_page] = prev_page
19
19
  opts[:meta][:next_page] = next_page
20
20
 
@@ -1,3 +1,3 @@
1
1
  module ActiveModelSerializersContrib
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
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.0.1
4
+ version: 0.1.0
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-06-29 00:00:00.000000000 Z
12
+ date: 2015-07-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.5
161
+ rubygems_version: 2.4.3
162
162
  signing_key:
163
163
  specification_version: 4
164
164
  summary: Modules/classes that extend AMS with more functionality