active_remote-cached 0.1.4 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/active_remote/cached.rb +11 -0
- data/lib/active_remote/cached/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b940a638579d7d52f0802cc3e92b8345135557bd44298fed674a896c885be7dc
|
4
|
+
data.tar.gz: 651e879207165b7b5ad651f73dabea9035e074f0d15e54ba8b9d6ea3d00d40c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be9de4a2047ea7fa752e933a2174e7dc8a5ac17a671bb800a2c481295b4a5eaccfd0cb4e90b71ccd091d75892721e91fea4135f6b14e4b956a1256403cbc21e7
|
7
|
+
data.tar.gz: 316686976d44d6f44731d358602c6b16ab5ce9c781a828f0202b1f68eaedb2bc559720487404f0ade6b2a23b22d37c5ee7d5ee4c5f813cbea30741be58ff388a
|
data/lib/active_remote/cached.rb
CHANGED
@@ -12,6 +12,10 @@ module ActiveRemote
|
|
12
12
|
module Cached
|
13
13
|
extend ::ActiveSupport::Concern
|
14
14
|
|
15
|
+
# When upgrading Rails versions, don't reuse the same cache key, because you can't rely upon the serialized objects to be consistent across versions.
|
16
|
+
# To fix, this adds a cache key that caches the ruby engine version and the activesupport version to prevent cache re-use across different versions.
|
17
|
+
RUBY_AND_ACTIVE_SUPPORT_VERSION = "#{RUBY_ENGINE_VERSION}:#{ActiveSupport::VERSION::STRING}".freeze
|
18
|
+
|
15
19
|
def self.cache(cache_provider = nil)
|
16
20
|
if cache_provider
|
17
21
|
@cache_provider = ::ActiveRemote::Cached::Cache.new(cache_provider)
|
@@ -144,6 +148,7 @@ module ActiveRemote
|
|
144
148
|
__active_remote_cached_options = ::ActiveRemote::Cached.default_options.merge(#{cached_finder_options}).merge(__active_remote_cached_options)
|
145
149
|
namespace = __active_remote_cached_options.delete(:namespace)
|
146
150
|
find_cache_key = [
|
151
|
+
RUBY_AND_ACTIVE_SUPPORT_VERSION,
|
147
152
|
namespace,
|
148
153
|
name,
|
149
154
|
"#find",
|
@@ -151,6 +156,7 @@ module ActiveRemote
|
|
151
156
|
].compact
|
152
157
|
|
153
158
|
search_cache_key = [
|
159
|
+
RUBY_AND_ACTIVE_SUPPORT_VERSION,
|
154
160
|
namespace,
|
155
161
|
name,
|
156
162
|
"#search",
|
@@ -176,6 +182,7 @@ module ActiveRemote
|
|
176
182
|
__active_remote_cached_options = ::ActiveRemote::Cached.default_options.merge(#{cached_finder_options}).merge(__active_remote_cached_options)
|
177
183
|
namespace = __active_remote_cached_options.delete(:namespace)
|
178
184
|
cache_key = [
|
185
|
+
RUBY_AND_ACTIVE_SUPPORT_VERSION,
|
179
186
|
namespace,
|
180
187
|
name,
|
181
188
|
"#find",
|
@@ -202,6 +209,7 @@ module ActiveRemote
|
|
202
209
|
__active_remote_cached_options = ::ActiveRemote::Cached.default_options.merge(#{cached_finder_options}).merge(__active_remote_cached_options)
|
203
210
|
namespace = __active_remote_cached_options.delete(:namespace)
|
204
211
|
cache_key = [
|
212
|
+
RUBY_AND_ACTIVE_SUPPORT_VERSION,
|
205
213
|
namespace,
|
206
214
|
name,
|
207
215
|
"#search",
|
@@ -241,6 +249,7 @@ module ActiveRemote
|
|
241
249
|
__active_remote_cached_options = ::ActiveRemote::Cached.default_options.merge(#{cached_finder_options}).merge(__active_remote_cached_options)
|
242
250
|
namespace = __active_remote_cached_options.delete(:namespace)
|
243
251
|
cache_key = [
|
252
|
+
RUBY_AND_ACTIVE_SUPPORT_VERSION,
|
244
253
|
namespace,
|
245
254
|
name,
|
246
255
|
"#find",
|
@@ -288,6 +297,7 @@ module ActiveRemote
|
|
288
297
|
__active_remote_cached_options = ::ActiveRemote::Cached.default_options.merge(#{cached_finder_options}).merge(__active_remote_cached_options)
|
289
298
|
namespace = __active_remote_cached_options.delete(:namespace)
|
290
299
|
cache_key = [
|
300
|
+
RUBY_AND_ACTIVE_SUPPORT_VERSION,
|
291
301
|
namespace,
|
292
302
|
name,
|
293
303
|
"#search",
|
@@ -340,6 +350,7 @@ module ActiveRemote
|
|
340
350
|
__active_remote_cached_options = ::ActiveRemote::Cached.default_options.merge(#{cached_finder_options}).merge(__active_remote_cached_options)
|
341
351
|
namespace = __active_remote_cached_options.delete(:namespace)
|
342
352
|
cache_key = [
|
353
|
+
RUBY_AND_ACTIVE_SUPPORT_VERSION,
|
343
354
|
namespace,
|
344
355
|
name,
|
345
356
|
"#search",
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_remote-cached
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Dewitt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_remote
|
@@ -139,8 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
139
139
|
- !ruby/object:Gem::Version
|
140
140
|
version: '0'
|
141
141
|
requirements: []
|
142
|
-
|
143
|
-
rubygems_version: 2.5.1
|
142
|
+
rubygems_version: 3.0.1
|
144
143
|
signing_key:
|
145
144
|
specification_version: 4
|
146
145
|
summary: Provides a configuration for caching mechanisms and finders on ActiveRemote
|