api_me 0.9.1 → 0.9.2

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: 7f73b06c558148f52ae844564f3c697cb04ce586
4
- data.tar.gz: b77391434d539d2f615c75392f014c3e8199add2
3
+ metadata.gz: d231552f1f01427534c97b10b0bf6f0ccd54a809
4
+ data.tar.gz: f433eb66eedb11efeef02161681414b340058773
5
5
  SHA512:
6
- metadata.gz: 5a44c7d690f5714307921c1f3a0ae7f2b7ba91e764f90c8b3f5f656a77b89f625df653e85e7d9e88dbf51f323bb4de1d1445849b6bb9dc6cd1ffdd8b15304a1c
7
- data.tar.gz: 3c21b4c1ba82cdd5a9dbd7137ba4f21c0370dc67c364053f9dab3a7f91ee0b4fa733245bcae51e51f505cf25d274358321abaaabb4eba2669328d53ed47a0955
6
+ metadata.gz: 815219a71fb808545bba8bd1e683f021e4ac35fb7407a057c09dfe5da030b5f0307de1845023ff931801fc0ebeace911abef85501523b2e181edc77cf2b36b68
7
+ data.tar.gz: 955c5ccabd618242121da6b91fb510534b0898eac7f2d8ade26d5097a38037099f6c8effd58095ba5c605f09cc599ac8910635cf73edefd71274d78bd7808213
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- api_me (0.9.1)
4
+ api_me (0.9.2)
5
5
  active_model_serializers (~> 0.10.0)
6
6
  activerecord (>= 4.1.16)
7
7
  activesupport (>= 4.1.16)
@@ -126,7 +126,7 @@ GEM
126
126
  ruby-progressbar (~> 1.7)
127
127
  unicode-display_width (~> 1.0, >= 1.0.1)
128
128
  ruby-progressbar (1.9.0)
129
- search_object (1.2.0)
129
+ search_object (1.2.1)
130
130
  sqlite3 (1.3.13)
131
131
  thor (0.20.0)
132
132
  thread_safe (0.3.6)
data/README.md CHANGED
@@ -125,6 +125,8 @@ return this.store.query('some-model', {
125
125
 
126
126
  To enable pagination just pass `page` in your request with `size` and `offset`.
127
127
 
128
+ Also see [ember-bootstrap-controls](http://wildland.github.io/ember-bootstrap-controls/?s=Bootstrap%20Controls&ss=Pagination) for a handy control for easy pagination with ember.
129
+
128
130
  Ember Example
129
131
  ````js
130
132
  return this.store.query('some-model', {
@@ -17,12 +17,18 @@ module ApiMe
17
17
 
18
18
  def page_meta
19
19
  return {} unless paging?
20
+ iteration_count_start = (page_size.to_i * (page_offset.to_i - 1)) + 1
21
+ iteration_count_end = page_size.to_i * page_offset.to_i
22
+ iteration_count_offset = scope.total_count < iteration_count_end ? scope.total_count : iteration_count_end
20
23
  {
21
24
  size: page_size.nil? ? default_page_size : page_size,
22
25
  offset: page_offset,
23
26
  record_count: scope.size,
24
27
  total_records: scope.total_count,
25
- total_pages: scope.total_pages
28
+ total_pages: scope.total_pages,
29
+ iteration_count_start: iteration_count_start,
30
+ iteration_count_end: iteration_count_end,
31
+ current_iteration_count: iteration_count_start - iteration_count_offset
26
32
  }
27
33
  end
28
34
 
@@ -1,3 +1,3 @@
1
1
  module ApiMe
2
- VERSION = '0.9.1'.freeze
2
+ VERSION = '0.9.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api_me
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Clopton
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-05-09 00:00:00.000000000 Z
12
+ date: 2018-06-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord