switchman 3.1.2 → 3.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/switchman/active_record/base.rb +14 -10
- 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: 54ae135ce532aa5578592027f6ce46cf3aedecdf0a6fd097ae3597752f436bae
|
|
4
|
+
data.tar.gz: 02d88f28e64e487c6841940a383afd92a56378ea7c2e4b1156252c0bcf0fa71f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 383075584faafb39abc64be4f6e77a99c4ca3dfd5acc1c57bae885ba71c8d13ce2cb0f89d9332fd8387f5100886a5a0ffbb6f6d53e382b0e54412aea6b72cf06
|
|
7
|
+
data.tar.gz: 875421e2c515a671ed8503fd07b55d22e16f098ddde635b5530a3ab4801c9bebd06a5e4e75d7a547b1e84e5628288dac9aefc0c6f9a23cedad80b1f8389bb5de
|
|
@@ -22,16 +22,20 @@ module Switchman
|
|
|
22
22
|
@integral_id
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
%w[transaction insert_all upsert_all].each do |method|
|
|
26
|
+
class_eval <<-RUBY, __FILE__, __LINE__ + 1
|
|
27
|
+
def #{method}(*, **)
|
|
28
|
+
if self != ::ActiveRecord::Base && current_scope
|
|
29
|
+
current_scope.activate do
|
|
30
|
+
db = Shard.current(connection_class_for_self).database_server
|
|
31
|
+
db.unguard { super }
|
|
32
|
+
end
|
|
33
|
+
else
|
|
34
|
+
db = Shard.current(connection_class_for_self).database_server
|
|
35
|
+
db.unguard { super }
|
|
36
|
+
end
|
|
30
37
|
end
|
|
31
|
-
|
|
32
|
-
db = Shard.current(connection_class_for_self).database_server
|
|
33
|
-
db.unguard { super }
|
|
34
|
-
end
|
|
38
|
+
RUBY
|
|
35
39
|
end
|
|
36
40
|
|
|
37
41
|
def reset_column_information
|
|
@@ -138,7 +142,7 @@ module Switchman
|
|
|
138
142
|
else
|
|
139
143
|
Shard.current(self.class.connection_class_for_self)
|
|
140
144
|
end
|
|
141
|
-
readonly! if shadow_record?
|
|
145
|
+
readonly! if shadow_record? && !Switchman.config[:writable_shadow_records]
|
|
142
146
|
super
|
|
143
147
|
end
|
|
144
148
|
|
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.1.
|
|
4
|
+
version: 3.1.3
|
|
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-
|
|
13
|
+
date: 2022-08-03 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: activerecord
|