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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 57faa64b0ae194cec1a1104b8001c25e231d1bb4dbbfc6d128ab1cafa5d752e8
4
- data.tar.gz: 44f881ebf1973f2035e5b8ed1c007add747d8a4f26d49bfb146595f2c3db3a5c
3
+ metadata.gz: b39f35492ea200776aaf47d09842ac0f3ddc9b2feeb0b582f116527e3ede531c
4
+ data.tar.gz: 38c22258be092078cfd94a55428f98abe6eba3fead710118e90738614ead271a
5
5
  SHA512:
6
- metadata.gz: 2e9a9aef16965c2051a9ae608e8c9e5333d65685002c6a6bffb6f6d0d6e0bb5b3894805a5643058b9b99920b5710ed05292967dce80af41c5a0a175cbddda835
7
- data.tar.gz: 2ae52545c34dbf92b963e9298a5735dc9cb34bc25795a26c07eda1a40b71ce04cf75094db2f9209c714c6abe5714b179d7476aae9b225c31f4d5667b9e1dd8e4
6
+ metadata.gz: 6aad32559cb9532b50e5e68870eae48929c4b35c2aaef621a36f72afa17d66f7f253e7e4b92013a56cfbbea63f7e12ac35be5697bda83d21a9c37b9262421192
7
+ data.tar.gz: 1fb20e21e76fa8affd0150774d5c69f5a70112203c62a3a6ebc1fdcab66583e8c91c079b65bc417cda4311d9d24001078b27319410f52c639b1904b447b3a12e
@@ -1,3 +1,3 @@
1
1
  module GrapeListing
2
- VERSION = '1.4.2'.freeze
2
+ VERSION = '1.4.3'.freeze
3
3
  end
@@ -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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-listing
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2
4
+ version: 1.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Павел Бабин