switchman 2.1.5 → 2.1.6
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32a8870f7b32fb16b98edcd9cd0930c30359df0a71a73ecc63752b256b5ac616
|
4
|
+
data.tar.gz: 90a3f31b1b8c5951720c7a45a3418c8448a5e08160939de73d487bfd8c9a7dc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 017200b98b0c53d0004c2632322e63141284716609b50400bf5936bf776aa06a68a648e1ff11df0d2d715e1993e051ea0e103c0356d0658ff121283447a376e7
|
7
|
+
data.tar.gz: 50cb3e155dd07d2d5e9171f788abce42b29b39d1f488d75cb97ae75842eda94876c4a9b0af134f1b0e03094bc14358c4b9ccc0677a83ebff741d948b9b496d5e
|
@@ -129,6 +129,11 @@ module Switchman
|
|
129
129
|
cached_shards[id]
|
130
130
|
end
|
131
131
|
|
132
|
+
def preload_cache
|
133
|
+
cached_shards.reverse_merge!(active_shards.values.index_by(&:id))
|
134
|
+
cached_shards.reverse_merge!(all.index_by(&:id))
|
135
|
+
end
|
136
|
+
|
132
137
|
def clear_cache
|
133
138
|
cached_shards.clear
|
134
139
|
end
|
@@ -13,6 +13,15 @@ module Switchman
|
|
13
13
|
shard.activate(self.class.shard_category) { super }
|
14
14
|
end
|
15
15
|
end
|
16
|
+
|
17
|
+
def delete
|
18
|
+
db = shard.database_server
|
19
|
+
if ::GuardRail.environment != db.guard_rail_environment
|
20
|
+
return db.unguard { super }
|
21
|
+
else
|
22
|
+
super
|
23
|
+
end
|
24
|
+
end
|
16
25
|
end
|
17
26
|
end
|
18
|
-
end
|
27
|
+
end
|
@@ -102,7 +102,7 @@ module Switchman
|
|
102
102
|
WHERE i.relkind = 'i'
|
103
103
|
AND d.indisprimary = 'f'
|
104
104
|
AND t.relname = '#{table_name}'
|
105
|
-
AND
|
105
|
+
AND t.relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname = '#{shard.name}' )
|
106
106
|
ORDER BY i.relname
|
107
107
|
SQL
|
108
108
|
|
data/lib/switchman/version.rb
CHANGED
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: switchman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cody Cutrer
|
8
8
|
- James Williams
|
9
9
|
- Jacob Fugal
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-08-
|
13
|
+
date: 2021-08-11 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: railties
|
@@ -257,7 +257,7 @@ homepage: http://www.instructure.com/
|
|
257
257
|
licenses:
|
258
258
|
- MIT
|
259
259
|
metadata: {}
|
260
|
-
post_install_message:
|
260
|
+
post_install_message:
|
261
261
|
rdoc_options: []
|
262
262
|
require_paths:
|
263
263
|
- lib
|
@@ -272,8 +272,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
272
272
|
- !ruby/object:Gem::Version
|
273
273
|
version: '0'
|
274
274
|
requirements: []
|
275
|
-
rubygems_version: 3.
|
276
|
-
signing_key:
|
275
|
+
rubygems_version: 3.2.24
|
276
|
+
signing_key:
|
277
277
|
specification_version: 4
|
278
278
|
summary: Rails sharding magic
|
279
279
|
test_files: []
|