kasket 4.12.0 → 4.13.0

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
  SHA256:
3
- metadata.gz: 52a098184223192a1d4a6cd6a92363dd5f9324b4d2c56da1fa33769402e0c602
4
- data.tar.gz: 4fca1aba72b41281fb71f91a61ba18d96edb93cb60ff94924c63fe7353bd96d7
3
+ metadata.gz: 0c1c83230c5c06c292c4dd62d839372d06a54a763ed7dfd0ea5ed339fb57913a
4
+ data.tar.gz: 96df87b7c7ee9f8f19e593b3bc3bcbad257d928e0cdc4e0b3f5b22afed00b9c6
5
5
  SHA512:
6
- metadata.gz: 4aa6be9f52ab44578929a3e66fa2ddfb71a6d935e00d13e80258fe4ec413ac69cae42666512e3711c189edf03e6e011ecd64a13d9a210449edc292aeea098680
7
- data.tar.gz: 0131bde86df784810b892da100e6e5c26e40620071c6169def6f7cbb7f176775ed981c7174c2be247a1c188053b755dab6469d9cd39e51104921f57d73721f72
6
+ metadata.gz: 1ced9df5e050870ed7446bcf1b2e469fa2954ce1e7afcd67b799b14bb25a7323690242ca5ebb097c8d7df7f5c0c70317a72f292c202bebcc189b7afb64e905d1
7
+ data.tar.gz: aef1d32b14c4d6c3526b2b9093fec72f2c1998c04bebcf40861a30a1226234e4a70976168e605358fb452ed9152e49a7d69564c2fd7583541056c66cbe7fc8f0
@@ -23,7 +23,7 @@ module Kasket
23
23
 
24
24
  if query && has_kasket_index_on?(query[:index])
25
25
  if query[:key].is_a?(Array)
26
- filter_pending_records(find_by_sql_with_kasket_on_id_array(query[:key]))
26
+ filter_pending_records(find_by_sql_with_kasket_on_id_array(query[:key]), &blk)
27
27
  else
28
28
  if value = Kasket.cache.read(query[:key])
29
29
  # Identified a specific edge case where memcached server returns 0x00 binary protocol response with no data
@@ -38,7 +38,7 @@ module Kasket
38
38
  elsif value.is_a?(Array)
39
39
  filter_pending_records(find_by_sql_with_kasket_on_id_array(value))
40
40
  else
41
- filter_pending_records(Array.wrap(value).collect { |record| instantiate(record.dup) })
41
+ filter_pending_records(Array.wrap(value).collect { |record| instantiate(record.dup, &blk) })
42
42
  end
43
43
 
44
44
  payload = {
@@ -56,11 +56,11 @@ module Kasket
56
56
  end
57
57
  end
58
58
 
59
- def find_by_sql_with_kasket_on_id_array(keys)
59
+ def find_by_sql_with_kasket_on_id_array(keys, &blk)
60
60
  key_attributes_map = Kasket.cache.read_multi(*keys)
61
61
 
62
62
  found_keys, missing_keys = keys.partition {|k| key_attributes_map[k] }
63
- found_keys.each {|k| key_attributes_map[k] = instantiate(key_attributes_map[k].dup) }
63
+ found_keys.each {|k| key_attributes_map[k] = instantiate(key_attributes_map[k].dup, &blk) }
64
64
  key_attributes_map.merge!(missing_records_from_db(missing_keys))
65
65
 
66
66
  key_attributes_map.values.compact
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  module Kasket
3
- VERSION = '4.12.0'
3
+ VERSION = '4.13.0'
4
4
  class Version
5
5
  MAJOR = Kasket::VERSION.split('.')[0]
6
6
  MINOR = Kasket::VERSION.split('.')[1]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kasket
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.12.0
4
+ version: 4.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mick Staugaard
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-03-24 00:00:00.000000000 Z
12
+ date: 2023-04-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord