grape_serializer 1.0.2 → 1.0.3

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: c2ecd6b18adf50c54e6d60b4b3ff921cc33a5af0232905de271b1be34e03e35b
4
+ data.tar.gz: b066c3dc899b6d98ca2bbf55286a0436dd32957a5ece0474280c7f6cce544f1e
5
5
  SHA512:
6
- metadata.gz: e99fc0d52af691c3fad9335d544da4557e175c9b20caba4015bdd9161b5e4d7467393b8cbc3ae4b816f779333550b250dc57de131efba1175f80586ab98e6882
7
- data.tar.gz: 0243e96fc109ee5288b31fe24c5fdbb18a6a15b4d187f29b0fd2a276751179b483f1e21d12c61f724d37af12b633122fb38f8eaebb7215042ccd0ec1bc0667a1
6
+ metadata.gz: 51e5b84a476a6474470c61dcdb19e32c21e5fd7f1da016c5624bf5284ee0fcf6396745cb365adb3a9ea96c0e624206e9356872136e6b360575bafab0bfe76e9d
7
+ data.tar.gz: 97163bc840a35b30051392eb047dec71c5b292191ca8608908899d67865741f4718f606307de465c7585a41083db7c84c56898f32783011f8308c0ea7a95981b
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.3
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: 2023-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grape-entity