grape_serializer 1.0.2 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/list_entity.rb +2 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fa4e4df474e763a22abed0ffb925b97217557d9c26a97a00a211ff46c7edeb49
4
- data.tar.gz: 142444464287db55fd57b7168def5624be1521ef6062cca7291560dec24f5456
3
+ metadata.gz: beed7e5350f2e92297eeaf1fd63801fe17eecccc8e1b37666c6cc6e8d374d678
4
+ data.tar.gz: 1d7d2884d642d29e89564f2f25de1cd079809d1a9ef8f7617bf70f67ce5bacf4
5
5
  SHA512:
6
- metadata.gz: e99fc0d52af691c3fad9335d544da4557e175c9b20caba4015bdd9161b5e4d7467393b8cbc3ae4b816f779333550b250dc57de131efba1175f80586ab98e6882
7
- data.tar.gz: 0243e96fc109ee5288b31fe24c5fdbb18a6a15b4d187f29b0fd2a276751179b483f1e21d12c61f724d37af12b633122fb38f8eaebb7215042ccd0ec1bc0667a1
6
+ metadata.gz: c45cdf62492b9c6bfbe658b8e2d5075f5bfb265fe58a24295e760e1cfad7ab47464381b40ae408f63f1aa731762b850561546c6ef85124da63831bc7cc1fcc0c
7
+ data.tar.gz: 42a22e325a9b666261c984ab46d4d6d5962699528fed32302e6652f50f5c198f1f072b3e01c44e1d26c3335cb5263b2ab74605763641593f95c5d9476a8c531f
data/lib/list_entity.rb CHANGED
@@ -33,8 +33,8 @@ class ListEntity < ServiceEntity
33
33
  def total_pages
34
34
  if pagination_items.respond_to?(:total_pages)
35
35
  pagination_items.total_pages
36
- else
37
- 0
36
+ elsif pagination_items.is_a?(Array)
37
+ pagination_items.length.zero? ? 0 : 1
38
38
  end
39
39
  end
40
40
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape_serializer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - JiaRou Lee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-11 00:00:00.000000000 Z
11
+ date: 2024-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grape-entity