solid_cache 1.0.7 → 1.0.8

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: 6c96752c871ba3eb453aca3f4c838b76afa0393486787109ef6e2f1ce1266a3d
4
- data.tar.gz: 57cf865289e1c289ceed0b0103f234b61f5283c4a693ba213d60e4e81d21f9f2
3
+ metadata.gz: fbc53d2cf4cc3edfeb5292055f3e8bb9c0057e4e067bee764a4d88a62fbd8278
4
+ data.tar.gz: e3e9eac0f9a24a26eb3e992b2d2cdd0037c5d9ca4c36ea7cf8751b257fdf152b
5
5
  SHA512:
6
- metadata.gz: be0dad91c5e93e775c0f7f528106b0d8ca69709d3d6d1fe4d95e834249abd267b86c5828d857e173fa1357da967362d290079df47f27bbcbcf56c3b7e9c80683
7
- data.tar.gz: ebc91d895a6721f1a8acf2ea4ee611bc8619aa3a432be492f9a934c7eae5796c6539cba51ebba9396245b5a09ca197cfbe6c8abd9c10fda60957c0f477987d51
6
+ metadata.gz: 3e94a6318abc57922c7b98c34b4034a660c8f598a557f0fb38a95f313228e02ae437396d415fe7bb2ed8782a492274458f621e059f74ea75905fd91b2bdee155
7
+ data.tar.gz: deebaed2b15b865e87aaf27ac521e0b85fb8ebffab19651dec622c6ad6008cb489ec1648059a26f7d870bf327b8295f70eb76651bb3465a5613a16c14b2901b8
data/README.md CHANGED
@@ -55,7 +55,7 @@ default:
55
55
  size_estimate_samples: 1000
56
56
 
57
57
  development: &development
58
- database: development_cache
58
+ database: cache
59
59
  store_options:
60
60
  <<: *default_store_options
61
61
  max_size: <%= 256.gigabytes %>
@@ -41,7 +41,9 @@ module SolidCache
41
41
  keys.each_slice(MULTI_BATCH_SIZE).each do |keys_batch|
42
42
  query = Arel.sql(select_sql(keys_batch), *key_hashes_for(keys_batch))
43
43
 
44
- results.merge!(connection.select_all(query, "SolidCache::Entry Load").cast_values(attribute_types).to_h)
44
+ with_connection do |connection|
45
+ results.merge!(connection.select_all(query, "SolidCache::Entry Load").cast_values(attribute_types).to_h)
46
+ end
45
47
  end
46
48
  end
47
49
  end
@@ -54,7 +56,9 @@ module SolidCache
54
56
  end
55
57
 
56
58
  def clear_truncate
57
- connection.truncate(table_name)
59
+ with_connection do |connection|
60
+ connection.truncate(table_name)
61
+ end
58
62
  end
59
63
 
60
64
  def clear_delete
@@ -91,7 +95,9 @@ module SolidCache
91
95
  end
92
96
 
93
97
  def upsert_unique_by
94
- connection.supports_insert_conflict_target? ? :key_hash : nil
98
+ with_connection do |connection|
99
+ connection.supports_insert_conflict_target? ? :key_hash : nil
100
+ end
95
101
  end
96
102
 
97
103
  # This constructs and caches a SQL query for a given number of keys.
@@ -14,14 +14,16 @@ module SolidCache
14
14
  end
15
15
 
16
16
  def with_instrumenter(instrumenter, &block)
17
- if connection.respond_to?(:with_instrumenter)
18
- connection.with_instrumenter(instrumenter, &block)
19
- else
20
- begin
21
- old_instrumenter, ActiveSupport::IsolatedExecutionState[:active_record_instrumenter] = ActiveSupport::IsolatedExecutionState[:active_record_instrumenter], instrumenter
22
- block.call
23
- ensure
24
- ActiveSupport::IsolatedExecutionState[:active_record_instrumenter] = old_instrumenter
17
+ with_connection do |connection|
18
+ if connection.respond_to?(:with_instrumenter)
19
+ connection.with_instrumenter(instrumenter, &block)
20
+ else
21
+ begin
22
+ old_instrumenter, ActiveSupport::IsolatedExecutionState[:active_record_instrumenter] = ActiveSupport::IsolatedExecutionState[:active_record_instrumenter], instrumenter
23
+ block.call
24
+ ensure
25
+ ActiveSupport::IsolatedExecutionState[:active_record_instrumenter] = old_instrumenter
26
+ end
25
27
  end
26
28
  end
27
29
  end
@@ -41,7 +41,7 @@ module SolidCache
41
41
  end
42
42
 
43
43
  config.after_initialize do
44
- if SolidCache.configuration.encrypt? && Record.connection.adapter_name == "PostgreSQL" && Rails::VERSION::MAJOR <= 7
44
+ if SolidCache.configuration.encrypt? && Record.lease_connection.adapter_name == "PostgreSQL" && Rails::VERSION::MAJOR <= 7
45
45
  raise \
46
46
  "Cannot enable encryption for Solid Cache: in Rails 7, Active Record Encryption does not support " \
47
47
  "encrypting binary columns on PostgreSQL"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolidCache
4
- VERSION = "1.0.7"
4
+ VERSION = "1.0.8"
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solid_cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Donal McBreen
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-02-06 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activerecord
@@ -141,9 +140,6 @@ licenses:
141
140
  metadata:
142
141
  homepage_uri: http://github.com/rails/solid_cache
143
142
  source_code_uri: http://github.com/rails/solid_cache
144
- post_install_message: |
145
- Upgrading from Solid Cache v0.3 or earlier? There are new database migrations in v0.4.
146
- See https://github.com/rails/solid_cache/blob/main/upgrading_to_version_0.4.x.md for upgrade instructions.
147
143
  rdoc_options: []
148
144
  require_paths:
149
145
  - lib
@@ -158,8 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
154
  - !ruby/object:Gem::Version
159
155
  version: '0'
160
156
  requirements: []
161
- rubygems_version: 3.5.22
162
- signing_key:
157
+ rubygems_version: 3.6.9
163
158
  specification_version: 4
164
159
  summary: A database backed ActiveSupport::Cache::Store
165
160
  test_files: []