grape-listing 1.4.2 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/grape_listing/version.rb +1 -1
- data/lib/listing_service/pagination.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b39f35492ea200776aaf47d09842ac0f3ddc9b2feeb0b582f116527e3ede531c
|
4
|
+
data.tar.gz: 38c22258be092078cfd94a55428f98abe6eba3fead710118e90738614ead271a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6aad32559cb9532b50e5e68870eae48929c4b35c2aaef621a36f72afa17d66f7f253e7e4b92013a56cfbbea63f7e12ac35be5697bda83d21a9c37b9262421192
|
7
|
+
data.tar.gz: 1fb20e21e76fa8affd0150774d5c69f5a70112203c62a3a6ebc1fdcab66583e8c91c079b65bc417cda4311d9d24001078b27319410f52c639b1904b447b3a12e
|
@@ -40,7 +40,7 @@ module GrapeListing
|
|
40
40
|
return cached if cached
|
41
41
|
|
42
42
|
# получение кол-ва записей из запроса к БД
|
43
|
-
count = list.distinct.count(:id)
|
43
|
+
count = list.merge(sort_proc).distinct.count(:id)
|
44
44
|
|
45
45
|
# кеширование кол-ва записей при превышении порогового значения
|
46
46
|
if count >= 1_000
|
@@ -54,7 +54,7 @@ module GrapeListing
|
|
54
54
|
# необходимо убрать параметры offset и page из uri
|
55
55
|
uri_path, params = @request_uri.split('?')
|
56
56
|
if params
|
57
|
-
params = Rack::Utils.parse_query(params).except('offset', 'page')
|
57
|
+
params = Rack::Utils.parse_query(params).except('offset', 'page', 'sort_order')
|
58
58
|
@request_uri = params.present? ? "#{uri_path}?#{Rack::Utils.build_query(params)}" : uri_path
|
59
59
|
end
|
60
60
|
|
@@ -62,7 +62,7 @@ module GrapeListing
|
|
62
62
|
body = "#{@request_method} #{@request_uri}"
|
63
63
|
|
64
64
|
enc = Digest::MD5.hexdigest(body)
|
65
|
-
"listing_cached_count_#{enc}"
|
65
|
+
"grape-listing:listing_cached_count_#{enc}"
|
66
66
|
end
|
67
67
|
|
68
68
|
|