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 +4 -4
- data/README.md +1 -1
- data/app/models/solid_cache/entry.rb +9 -3
- data/app/models/solid_cache/record.rb +10 -8
- data/lib/solid_cache/engine.rb +1 -1
- data/lib/solid_cache/version.rb +1 -1
- metadata +3 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fbc53d2cf4cc3edfeb5292055f3e8bb9c0057e4e067bee764a4d88a62fbd8278
|
4
|
+
data.tar.gz: e3e9eac0f9a24a26eb3e992b2d2cdd0037c5d9ca4c36ea7cf8751b257fdf152b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e94a6318abc57922c7b98c34b4034a660c8f598a557f0fb38a95f313228e02ae437396d415fe7bb2ed8782a492274458f621e059f74ea75905fd91b2bdee155
|
7
|
+
data.tar.gz: deebaed2b15b865e87aaf27ac521e0b85fb8ebffab19651dec622c6ad6008cb489ec1648059a26f7d870bf327b8295f70eb76651bb3465a5613a16c14b2901b8
|
data/README.md
CHANGED
@@ -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
|
-
|
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
|
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
|
-
|
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
|
-
|
18
|
-
connection.with_instrumenter
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
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
|
data/lib/solid_cache/engine.rb
CHANGED
@@ -41,7 +41,7 @@ module SolidCache
|
|
41
41
|
end
|
42
42
|
|
43
43
|
config.after_initialize do
|
44
|
-
if SolidCache.configuration.encrypt? && Record.
|
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"
|
data/lib/solid_cache/version.rb
CHANGED
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.
|
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:
|
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.
|
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: []
|