switchman 3.5.0 → 3.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/switchman/active_record/persistence.rb +18 -0
- data/lib/switchman/version.rb +1 -1
- data/lib/switchman.rb +2 -0
- 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: f381ad09908e23b0560c685c530f7ffae1a0adcbbaf6640b5ae4f267dd9323f3
|
4
|
+
data.tar.gz: 1ca68afa9a03005c7c5966f8bc8a6be06f552c086ca469fe4b9eab1a54e819ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3340807bd81183c24527ba2739732e6ac5aa413d1184c22d4b1ad2d3cc0674b5222d1cf5ddb7abad158108a35e6c226bf9c7614f55fc890debbee0f20147ef98
|
7
|
+
data.tar.gz: e67e961f5f4085ed7d0b00c272d8f8c911d14b284415e8bab2f528c25177db8504c8c7e8ceafa5e4ac5389e0f3f548f8d069838e21c6f8099864a91d5655d5a9
|
@@ -5,10 +5,12 @@ module Switchman
|
|
5
5
|
module Persistence
|
6
6
|
# touch reads the id attribute directly, so it's not relative to the current shard
|
7
7
|
def touch(*, **)
|
8
|
+
writable_shadow_record_warning
|
8
9
|
shard.activate(self.class.connection_class_for_self) { super }
|
9
10
|
end
|
10
11
|
|
11
12
|
def update_columns(*)
|
13
|
+
writable_shadow_record_warning
|
12
14
|
shard.activate(self.class.connection_class_for_self) { super }
|
13
15
|
end
|
14
16
|
|
@@ -17,6 +19,16 @@ module Switchman
|
|
17
19
|
db.unguard { super }
|
18
20
|
end
|
19
21
|
|
22
|
+
def destroy
|
23
|
+
writable_shadow_record_warning
|
24
|
+
super
|
25
|
+
end
|
26
|
+
|
27
|
+
def create_or_update(**, &block)
|
28
|
+
writable_shadow_record_warning
|
29
|
+
super
|
30
|
+
end
|
31
|
+
|
20
32
|
def reload(*)
|
21
33
|
res = super
|
22
34
|
# When a shadow record is reloaded the real record is returned. So
|
@@ -24,6 +36,12 @@ module Switchman
|
|
24
36
|
@loaded_from_shard = @shard
|
25
37
|
res
|
26
38
|
end
|
39
|
+
|
40
|
+
def writable_shadow_record_warning
|
41
|
+
return unless shadow_record? && Switchman.config[:writable_shadow_records]
|
42
|
+
|
43
|
+
Switchman::Deprecation.warn("writing to shadow records is not supported")
|
44
|
+
end
|
27
45
|
end
|
28
46
|
end
|
29
47
|
end
|
data/lib/switchman/version.rb
CHANGED
data/lib/switchman.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.5.
|
4
|
+
version: 3.5.1
|
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-05-
|
13
|
+
date: 2023-05-09 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activerecord
|