pagy 3.8.0 → 3.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/config/pagy.rb +1 -1
- data/lib/javascripts/pagy.js +2 -2
- data/lib/pagy.rb +1 -1
- data/lib/pagy/extras/elasticsearch_rails.rb +1 -1
- data/lib/pagy/extras/i18n.rb +8 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ea52feecd4bb597b050def40adc283602005ff5e92b4df578228e05d747f9ef
|
4
|
+
data.tar.gz: 808775763c37c92e3457214284fffcfc1075a7c8fbde1da39286b35c06923424
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80015e89122214f8e8054e2c8e8490b407f4fb9513a4336458eeedd2b5bc986e27abf339830157392afd9cd8f901d61fcd0403480fe7acb093da27d68f9d800b
|
7
|
+
data.tar.gz: ec2ab4d61e3763c580d011565811a55595b15f1f7498b9879dd20f6986f5b470f155f1f4ff5c74286892836c5a2f133e0f2d17e32f82d2b0e1e737a876b89155
|
data/lib/config/pagy.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
# Pagy initializer file (3.8.
|
4
|
+
# Pagy initializer file (3.8.1)
|
5
5
|
# Customize only what you really need and notice that Pagy works also without any of the following lines.
|
6
6
|
# Should you just cherry pick part of this file, please maintain the require-order of the extras
|
7
7
|
|
data/lib/javascripts/pagy.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
function Pagy(){}
|
4
4
|
|
5
|
-
Pagy.version = '3.8.
|
5
|
+
Pagy.version = '3.8.1';
|
6
6
|
|
7
7
|
Pagy.init = function(arg){
|
8
8
|
var target = arg instanceof Event || arg === undefined ? document : arg,
|
@@ -101,6 +101,6 @@ Pagy.addInputEventListeners = function(input, handler){
|
|
101
101
|
};
|
102
102
|
|
103
103
|
Pagy.trim = function(html, param){
|
104
|
-
var re = new RegExp('[?&]' + param + '=1
|
104
|
+
var re = new RegExp('[?&]' + param + '=1\\b(?!&)|\\b' + param + '=1&');
|
105
105
|
return html.replace(re, '');
|
106
106
|
};
|
data/lib/pagy.rb
CHANGED
@@ -28,7 +28,7 @@ class Pagy
|
|
28
28
|
search_args[-1][:size] = vars[:items]
|
29
29
|
search_args[-1][:from] = vars[:items] * (vars[:page] - 1)
|
30
30
|
response = model.search(*search_args)
|
31
|
-
total = response.raw_response['hits']['total']
|
31
|
+
total = response.respond_to?(:raw_response) ? response.raw_response['hits']['total'] : response.response['hits']['total']
|
32
32
|
vars[:count] = total.is_a?(Hash) ? total['value'] : total
|
33
33
|
pagy = Pagy.new(vars)
|
34
34
|
# with :last_page overflow we need to re-run the method in order to get the hits
|
data/lib/pagy/extras/i18n.rb
CHANGED
@@ -11,7 +11,14 @@ class Pagy
|
|
11
11
|
Pagy::I18n.clear.instance_eval { undef :load; undef :t } # unload the pagy default constant for efficiency
|
12
12
|
|
13
13
|
alias_method :pagy_without_i18n, :pagy_t
|
14
|
-
|
14
|
+
if Gem::Version.new(::I18n::VERSION) < Gem::Version.new('1.6.0')
|
15
|
+
def pagy_t_with_i18n(*args) ::I18n.t(*args) end
|
16
|
+
else
|
17
|
+
# keep 1.9 compatibility by hiding 2.0+ syntax in string
|
18
|
+
module_eval <<-RUBY
|
19
|
+
def pagy_t_with_i18n(key, **opts) ::I18n.t(key, **opts) end
|
20
|
+
RUBY
|
21
|
+
end
|
15
22
|
alias_method :pagy_t, :pagy_t_with_i18n
|
16
23
|
|
17
24
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pagy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.8.
|
4
|
+
version: 3.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Domizio Demichelis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: 'Agnostic pagination in plain ruby: it works with any framework, ORM
|
14
14
|
and DB type, with all kinds of collections, even pre-paginated, scopes, Arrays,
|
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
110
|
- !ruby/object:Gem::Version
|
111
111
|
version: '0'
|
112
112
|
requirements: []
|
113
|
-
rubygems_version: 3.
|
113
|
+
rubygems_version: 3.1.2
|
114
114
|
signing_key:
|
115
115
|
specification_version: 4
|
116
116
|
summary: The Ultimate Pagination Ruby Gem
|