avromatic 0.11.1 → 0.11.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/avromatic/model/type_registry.rb +8 -1
- data/lib/avromatic/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 413739978c36254c583ae736d1251f80999d28da
|
4
|
+
data.tar.gz: 8558a6bb564d275cc8f63b2e8480893d49db5267
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22be0967a00f55feb617dd3f15ad91e637d060aebac5fb5b0034f82de452546feb08ec1e2ba0ac1d0d3cd99e5645cbccde58bbd5f1ce7cde46f53eb86387d8d8
|
7
|
+
data.tar.gz: 938539514b19b347a4b3b983c09ff5cadb4f9a21d2920c4572f082db7be11e96fb5cc4deca21464c074c7e5bd9beedbd2d7387b6ca69a2a9351b99032afc8a8e
|
data/CHANGELOG.md
CHANGED
@@ -27,7 +27,7 @@ module Avromatic
|
|
27
27
|
def fetch(object, field_class = nil)
|
28
28
|
field_type = object.is_a?(Avro::Schema::Field) ? object.type : object
|
29
29
|
|
30
|
-
if field_class && field_type.type_sym == :union && !(field_class
|
30
|
+
if field_class && field_type.type_sym == :union && !union_attribute?(field_class)
|
31
31
|
field_type = Avromatic::Model::Attributes.first_union_schema(field_type)
|
32
32
|
end
|
33
33
|
|
@@ -38,6 +38,13 @@ module Avromatic
|
|
38
38
|
private
|
39
39
|
|
40
40
|
attr_reader :custom_types
|
41
|
+
|
42
|
+
# The type that is used to define a Virtus attribute may be a Class or
|
43
|
+
# for an array or map field it may be an instance of an Array or Hash.
|
44
|
+
# This method safely checks if a Union class has been selected.
|
45
|
+
def union_attribute?(attribute_type)
|
46
|
+
attribute_type.is_a?(Class) && attribute_type < Avromatic::Model::AttributeType::Union
|
47
|
+
end
|
41
48
|
end
|
42
49
|
end
|
43
50
|
end
|
data/lib/avromatic/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avromatic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Salsify Engineering
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: avro
|