switchman 1.14.3 → 1.14.4

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: afdf70e3dff70e6483a536a509b202ce19dc22b3ac6a1eadb3af049d40f6482e
4
- data.tar.gz: f8fd04a1f0db484b5673a3c17c981505199b3c31d9863d6903e495d60e8524d9
3
+ metadata.gz: 8afca28f08e2790f1ea2ff7cb19b1920a30da7eea8fca6d1e766f0550178e451
4
+ data.tar.gz: e10d84284ce03587f66dffa474fdd78f07fbd3a4b35139640713a0f8283a1c26
5
5
  SHA512:
6
- metadata.gz: 4d4abe787ed871ea4df97ae1d548f3f0fe9f669c3a61300cb78a4ead6c23e217f95413d86d4704645240ae2d9c15a6f1ada2c7100904fd600f5ec710140df69e
7
- data.tar.gz: 5170eafe6bb1f4f99b9613eab34eadcc7b5767dd2f686d4885d6a0965241982a2c717d434af6962d60e2e9f9e664e7673b38dbda46f6b79ac103802b77883e50
6
+ metadata.gz: ae60e16501fb7c1b0641fb546f78013b61c96cbb01c9b1f485ef6d23c5ed1aceedd86aad508e3a3e986dd59f07eb4a414e4b3d61a1959bc8ec58de1ace58e07b
7
+ data.tar.gz: d52f3b4b4a77d517067d988b48a4254d6f734d4f59ec7e7a973affd63fcfe7e8de8c0f4ecd69baa083c90d665e323e3327431f7ef3379e648ef81fdef8c3f89b
@@ -75,6 +75,11 @@ module Switchman
75
75
  if @default.database_server.instance_variable_defined?(:@primary_shard)
76
76
  @default.database_server.remove_instance_variable(:@primary_shard)
77
77
  end
78
+
79
+ # and finally, check for cached references to the default shard on the existing connection
80
+ if ::ActiveRecord::Base.connected? && ::ActiveRecord::Base.connection.shard.default?
81
+ ::ActiveRecord::Base.connection.shard = @default
82
+ end
78
83
  end
79
84
  @default
80
85
  end
@@ -1,3 +1,3 @@
1
1
  module Switchman
2
- VERSION = "1.14.3"
2
+ VERSION = "1.14.4"
3
3
  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: 1.14.3
4
+ version: 1.14.4
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: 2019-07-31 00:00:00.000000000 Z
13
+ date: 2019-08-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: railties