switchman 1.14.2 → 1.14.3
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/base.rb +6 -3
- 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: afdf70e3dff70e6483a536a509b202ce19dc22b3ac6a1eadb3af049d40f6482e
|
4
|
+
data.tar.gz: f8fd04a1f0db484b5673a3c17c981505199b3c31d9863d6903e495d60e8524d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d4abe787ed871ea4df97ae1d548f3f0fe9f669c3a61300cb78a4ead6c23e217f95413d86d4704645240ae2d9c15a6f1ada2c7100904fd600f5ec710140df69e
|
7
|
+
data.tar.gz: 5170eafe6bb1f4f99b9613eab34eadcc7b5767dd2f686d4885d6a0965241982a2c717d434af6962d60e2e9f9e664e7673b38dbda46f6b79ac103802b77883e50
|
@@ -153,9 +153,12 @@ module Switchman
|
|
153
153
|
def shard_category_for_reflection(reflection)
|
154
154
|
if reflection
|
155
155
|
if reflection.options[:polymorphic]
|
156
|
-
|
157
|
-
|
158
|
-
|
156
|
+
begin
|
157
|
+
read_attribute(reflection.foreign_type)&.constantize&.shard_category || :primary
|
158
|
+
rescue NameError
|
159
|
+
# in case someone is abusing foreign_type to not point to an actual class
|
160
|
+
:primary
|
161
|
+
end
|
159
162
|
else
|
160
163
|
# otherwise we can just return a symbol for the statically known type of the association
|
161
164
|
reflection.klass.shard_category
|
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: 1.14.
|
4
|
+
version: 1.14.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: 2019-07-
|
13
|
+
date: 2019-07-31 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: railties
|