switchman 3.5.11 → 3.5.12

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: 66fb79b6ead1a010749a4c707e9d3b6f1d1af3af3ce79748c12a4c74940d1238
4
- data.tar.gz: c8cd71c46f6dc930d6129b8b7ea033286c02a81ddd650f69580d310865f7065c
3
+ metadata.gz: 9a18e4da75efcd07fcf8d46d08397d2323c7795f3f971a66561e03944383bf4e
4
+ data.tar.gz: 65963d628b6a011a7e29d7b76735f6d6318afec42b3359e5cd4c6f4c21e591c6
5
5
  SHA512:
6
- metadata.gz: 7d69de4d0dccbffede8882e50144aaa35840b7374e2d4265ff01eb3a78f3b5001934886dedb0e0e67f23c31fc6ee8a2b9aad1dca2e7fa093e16dd5deac85cada
7
- data.tar.gz: cfb5b3f62773187207904ca822188344cf3c3d4d6d24d27d0b801d071bdf98b6250ad314531a6dce0e06e8c0a13474486a37dbc382c8b4ebedb18cab923db5a3
6
+ metadata.gz: 278b27e999056a7b9a8bf1fbed3f4de12b110fc269410b7ffaf4c7fdcd340ef37e2af8174dd2ce499e90ab07483ee057261067224c474053707ab2de67c3c41c
7
+ data.tar.gz: 5d9aa9b061b88fe2ea62d11005eaf4db9e05c9c65da11fd6d82bdaf5ddb707507bd024b95a2b9fca1ab3b194a158fbfc8ce66e5f6b5d5f9bf9327cd121d897ba
@@ -158,7 +158,15 @@ module Switchman
158
158
  end
159
159
 
160
160
  @loaded_from_shard ||= Shard.current(self.class.connection_class_for_self)
161
- readonly! if shadow_record? && !Switchman.config[:writable_shadow_records]
161
+ if shadow_record? && !Switchman.config[:writable_shadow_records]
162
+ @readonly = true
163
+ @readonly_from_shadow ||= true
164
+ end
165
+ super
166
+ end
167
+
168
+ def readonly!
169
+ @readonly_from_shadow = false
162
170
  super
163
171
  end
164
172
 
@@ -34,6 +34,10 @@ module Switchman
34
34
  # When a shadow record is reloaded the real record is returned. So
35
35
  # we need to ensure the loaded_from_shard is set correctly after a reload.
36
36
  @loaded_from_shard = @shard
37
+ if @readonly_from_shadow
38
+ @readonly_from_shadow = false
39
+ @readonly = false
40
+ end
37
41
  res
38
42
  end
39
43
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Switchman
4
- VERSION = "3.5.11"
4
+ VERSION = "3.5.12"
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.5.11
4
+ version: 3.5.12
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: 2023-10-02 00:00:00.000000000 Z
13
+ date: 2023-10-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord