switchman 3.0.22 → 3.0.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/switchman/action_controller/caching.rb +2 -2
- data/lib/switchman/engine.rb +7 -2
- data/lib/switchman/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cdf70d4f479a11fe962b4aec7c0849f95abcb95f233ae7b5fa580608977e92b5
|
4
|
+
data.tar.gz: 81fe21a7875fdfbe20af3e36f778fc9a0cde2db3b595511264df87d62f5d8185
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 514d638f160d69c9df7fc272c344eb8ea0b60ef2aa4b802e05b6f0ad41cf34b71e041a838ebbc133bf4ff285a490ad2b40ec83e4417057bbb95edf1090f4fecf
|
7
|
+
data.tar.gz: 6ae5191dbed97e7ceb57c5bbe2704d34c576905ef0a0ec512864802146d057d3c8a4bfbd7d1ee88e882e8f9b1b8124a1edb47b04b5b335c33ae82e36a758975f
|
@@ -13,8 +13,8 @@ module Switchman
|
|
13
13
|
# disallow assigning to ActionController::Base.cache_store or
|
14
14
|
# ActionController::Base#cache_store for the same reasons we disallow
|
15
15
|
# assigning to Rails.cache
|
16
|
-
def cache_store=(
|
17
|
-
raise NoMethodError
|
16
|
+
def cache_store=(cache)
|
17
|
+
raise NoMethodError unless cache == ::Rails.cache
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
data/lib/switchman/engine.rb
CHANGED
@@ -10,7 +10,12 @@ module Switchman
|
|
10
10
|
|
11
11
|
::GuardRail.singleton_class.prepend(GuardRail::ClassMethods)
|
12
12
|
|
13
|
-
|
13
|
+
# after :initialize_dependency_mechanism to ensure autoloading is configured for any downstream initializers that care
|
14
|
+
# In rails 7.0 we should be able to just use an explicit after on configuring the once autoloaders and not need to go monkey around with initializer order
|
15
|
+
initialize_dependency_mechanism = ::Rails::Application::Bootstrap.initializers.find { |i| i.name == :initialize_dependency_mechanism }
|
16
|
+
initialize_dependency_mechanism.instance_variable_get(:@options)[:after] = :set_autoload_paths
|
17
|
+
|
18
|
+
initializer 'switchman.active_record_patch', before: 'active_record.initialize_database', after: :initialize_dependency_mechanism do
|
14
19
|
::ActiveSupport.on_load(:active_record) do
|
15
20
|
# Switchman requires postgres, so just always load the pg adapter
|
16
21
|
require 'active_record/connection_adapters/postgresql_adapter'
|
@@ -96,7 +101,7 @@ module Switchman
|
|
96
101
|
end
|
97
102
|
end
|
98
103
|
|
99
|
-
initializer 'switchman.initialize_cache', before:
|
104
|
+
initializer 'switchman.initialize_cache', before: :initialize_cache, after: 'active_record.initialize_database' do
|
100
105
|
::ActiveSupport::Cache.singleton_class.prepend(ActiveSupport::Cache::ClassMethods)
|
101
106
|
|
102
107
|
# if we haven't already setup our cache map out-of-band, set it up from
|
data/lib/switchman/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: switchman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cody Cutrer
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2022-04-
|
13
|
+
date: 2022-04-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activerecord
|