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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f6ed57a128cb7da74d0df280b924f4369dcd224039343f4476796ae09d8573f5
4
- data.tar.gz: 732fbee6c445f210f9b97b3921f30356a2eb7f9df1c925631dccce5e91612904
3
+ metadata.gz: cdf70d4f479a11fe962b4aec7c0849f95abcb95f233ae7b5fa580608977e92b5
4
+ data.tar.gz: 81fe21a7875fdfbe20af3e36f778fc9a0cde2db3b595511264df87d62f5d8185
5
5
  SHA512:
6
- metadata.gz: 8fdbbdc4309ebac36a0c779aefe89163f16419581752307223a367c3e47197d96a64daa8f8c4182b1b94512cf871891e531ea5c99616b0fc2e808c1b698d4f24
7
- data.tar.gz: 93bd4a98e64cba28e28a80f4b33e8c93ef00ef3ba1c467b81c2ac93665ae0678acd2715d3781566c4e60df29749a353f08546d7aff9809fef2e53b5eb7f81d43
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=(_cache)
17
- raise NoMethodError
16
+ def cache_store=(cache)
17
+ raise NoMethodError unless cache == ::Rails.cache
18
18
  end
19
19
  end
20
20
 
@@ -10,7 +10,12 @@ module Switchman
10
10
 
11
11
  ::GuardRail.singleton_class.prepend(GuardRail::ClassMethods)
12
12
 
13
- initializer 'switchman.active_record_patch', before: 'active_record.initialize_database' do
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: 'initialize_cache', after: 'switchman.active_record_patch' do
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Switchman
4
- VERSION = '3.0.22'
4
+ VERSION = '3.0.23'
5
5
  end
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.22
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-07 00:00:00.000000000 Z
13
+ date: 2022-04-25 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord