pagy 4.10.0 → 4.10.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 +1 -1
- data/lib/pagy.rb +1 -1
- data/lib/pagy/extras/meilisearch.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfababb2b5f9594ebcf7827cde7c45e9073ba9a270ddca251714e0d8fa1ef711
|
4
|
+
data.tar.gz: b20c84d4099a7302d6324fa671001051275d01d363eff5b6007d4240b1700d8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba6eadeb0285c6dcf1ae98dfe58fe8844916f3d517813fbc8add6b5b0e0d3933234e26eb15c9fa931c7fccd256844df26d72694f23a3596fa874c3288a4fd4aa
|
7
|
+
data.tar.gz: 35d1b022f3d4c85521e69b960be16812c5ffe276e1a015e6fa9ce1630f1abf05486908568585dcd0257fee4d2fb304fe6296839404a9091e54a3c6fa10d0068b
|
data/lib/config/pagy.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Pagy initializer file (4.10.
|
3
|
+
# Pagy initializer file (4.10.1)
|
4
4
|
# Customize only what you really need and notice that Pagy works also without any of the following lines.
|
5
5
|
# Should you just cherry pick part of this file, please maintain the require-order of the extras
|
6
6
|
|
data/lib/javascripts/pagy.js
CHANGED
data/lib/pagy.rb
CHANGED
@@ -15,9 +15,9 @@ class Pagy
|
|
15
15
|
|
16
16
|
# create a Pagy object from a Meilisearch results
|
17
17
|
def self.new_from_meilisearch(results, vars={})
|
18
|
-
vars[:items] = results.raw_answer[
|
19
|
-
vars[:page] = [results.raw_answer[
|
20
|
-
vars[:count] = results.raw_answer[
|
18
|
+
vars[:items] = results.raw_answer['limit']
|
19
|
+
vars[:page] = [results.raw_answer['offset'] / vars[:items], 1].max
|
20
|
+
vars[:count] = results.raw_answer['nbHits']
|
21
21
|
new(vars)
|
22
22
|
end
|
23
23
|
|
@@ -32,7 +32,7 @@ class Pagy
|
|
32
32
|
options[:limit] = vars[:items]
|
33
33
|
options[:offset] = (vars[:page] - 1) * vars[:items]
|
34
34
|
results = model.search(term, **options)
|
35
|
-
vars[:count] = results.raw_answer[
|
35
|
+
vars[:count] = results.raw_answer['nbHits']
|
36
36
|
|
37
37
|
pagy = Pagy.new(vars)
|
38
38
|
# with :last_page overflow we need to re-run the method in order to get the hits
|
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: 4.10.
|
4
|
+
version: 4.10.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: 2021-06-
|
11
|
+
date: 2021-06-24 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,
|