jsonapi.rb 1.5.0 → 1.5.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: b3492c86c9c8e6353590ddd3adad00d0e554e440
4
- data.tar.gz: e4f87cea9894b17a0da2214c809fafa0fcebf1aa
3
+ metadata.gz: e8ab954fc5d38b6dca31a478d98b73fb98927221
4
+ data.tar.gz: 5b3f497a7eabdf96f487f2101f8b5b6783692a03
5
5
  SHA512:
6
- metadata.gz: fdf8daac2d2c4a163dd345f4040fc580dae562a32e5e9300a38712fd08e3e58dc0b88ffbbb044e3a2a6eeb5ac10263fa53fd73aeee7763c7abe940d3e9673f9a
7
- data.tar.gz: 25d316c614bf7801fd7a5a7b701e285368acd05f8cb0e048c621a720f00752bcf3dfa113ff9d1dfe8c8921b269a556a52a88b7bedc1db81e42300bd901fb3d91
6
+ metadata.gz: 1a7d7d8c51e68f657273c5b4cb4e8441f9f53eddc0c928c2974bc5c0603339cc680e8b5dd0648930dbcc0af0ef9f30673d3f84b994c3a507a590f7a0a5d139e3
7
+ data.tar.gz: f2a57cd3c285eb074bc0a05f01e94f510e10eafc0b90f5d1fbdbfca80df86882490145e986b12f6ea29cdf30d4b799ce39dce3f867dd7601a661d82b4274e348
@@ -8,7 +8,7 @@ GIT
8
8
  PATH
9
9
  remote: .
10
10
  specs:
11
- jsonapi.rb (1.5.0)
11
+ jsonapi.rb (1.5.1)
12
12
  fast_jsonapi (~> 1.5)
13
13
  rack
14
14
  ransack
@@ -87,8 +87,8 @@ module JSONAPI
87
87
  def_per_page = self.class.const_get(:JSONAPI_PAGE_SIZE).to_i
88
88
 
89
89
  pagination = params[:page].try(:slice, :number, :size) || {}
90
- per_page = (pagination[:size] || def_per_page).to_f.to_i
91
- per_page = def_per_page if per_page > def_per_page
90
+ per_page = pagination[:size].to_f.to_i
91
+ per_page = def_per_page if per_page > def_per_page || per_page < 1
92
92
  num = [1, pagination[:number].to_f.to_i].max
93
93
 
94
94
  [(num - 1) * per_page, per_page, num]
@@ -1,3 +1,3 @@
1
1
  module JSONAPI
2
- VERSION = '1.5.0'
2
+ VERSION = '1.5.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonapi.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stas Suscov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-05 00:00:00.000000000 Z
11
+ date: 2019-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fast_jsonapi