deimos-ruby 2.0.1 → 2.0.2
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/CHANGELOG.md +2 -1
- data/CHANGELOG.md.orig +609 -0
- data/lib/deimos/schema_backends/avro_schema_coercer.rb +1 -39
- data/lib/deimos/version.rb +1 -1
- data/spec/active_record_producer_spec.rb +5 -111
- data/spec/snapshots/consumers-no-nest.snap +0 -218
- data/spec/snapshots/consumers.snap +0 -188
- data/spec/snapshots/consumers_and_producers-no-nest.snap +0 -218
- data/spec/snapshots/consumers_and_producers.snap +0 -188
- data/spec/snapshots/consumers_circular-no-nest.snap +0 -218
- data/spec/snapshots/consumers_circular.snap +0 -188
- data/spec/snapshots/consumers_complex_types-no-nest.snap +0 -218
- data/spec/snapshots/consumers_complex_types.snap +0 -188
- data/spec/snapshots/consumers_nested-no-nest.snap +0 -218
- data/spec/snapshots/consumers_nested.snap +0 -188
- data/spec/snapshots/namespace_folders.snap +0 -188
- data/spec/snapshots/namespace_map.snap +0 -188
- data/spec/snapshots/producers_with_key-no-nest.snap +0 -218
- data/spec/snapshots/producers_with_key.snap +0 -188
- data/spec/spec_helper.rb +0 -25
- metadata +2 -5
- data/spec/schemas/com/my-namespace/MySchemaWithUnionType.avsc +0 -91
- data/spec/schemas/my_namespace/my_schema_with_union_type.rb +0 -185
@@ -1008,194 +1008,6 @@ module Schemas; module MyNamespace
|
|
1008
1008
|
end; end
|
1009
1009
|
|
1010
1010
|
|
1011
|
-
spec/app/lib/schema_classes/schemas/my_namespace/my_schema_with_union_type.rb:
|
1012
|
-
# frozen_string_literal: true
|
1013
|
-
|
1014
|
-
# This file is autogenerated by Deimos, Do NOT modify
|
1015
|
-
module Schemas; module MyNamespace
|
1016
|
-
### Primary Schema Class ###
|
1017
|
-
# Autogenerated Schema for Record at com.my-namespace.MySchemaWithUnionType
|
1018
|
-
class MySchemaWithUnionType < Deimos::SchemaClass::Record
|
1019
|
-
|
1020
|
-
### Secondary Schema Classes ###
|
1021
|
-
# Autogenerated Schema for Record at com.flipp.content.Record1
|
1022
|
-
class Record1 < Deimos::SchemaClass::Record
|
1023
|
-
|
1024
|
-
### Attribute Accessors ###
|
1025
|
-
# @return [Hash<String, Integer>]
|
1026
|
-
attr_accessor :record1_map
|
1027
|
-
# @return [Integer]
|
1028
|
-
attr_accessor :record1_id
|
1029
|
-
|
1030
|
-
# @override
|
1031
|
-
def initialize(record1_map: {},
|
1032
|
-
record1_id: 0)
|
1033
|
-
super
|
1034
|
-
self.record1_map = record1_map
|
1035
|
-
self.record1_id = record1_id
|
1036
|
-
end
|
1037
|
-
|
1038
|
-
# @override
|
1039
|
-
def schema
|
1040
|
-
'Record1'
|
1041
|
-
end
|
1042
|
-
|
1043
|
-
# @override
|
1044
|
-
def namespace
|
1045
|
-
'com.flipp.content'
|
1046
|
-
end
|
1047
|
-
|
1048
|
-
# @override
|
1049
|
-
def as_json(_opts={})
|
1050
|
-
{
|
1051
|
-
'record1_map' => @record1_map,
|
1052
|
-
'record1_id' => @record1_id
|
1053
|
-
}
|
1054
|
-
end
|
1055
|
-
end
|
1056
|
-
|
1057
|
-
# Autogenerated Schema for Record at com.flipp.content.Record2
|
1058
|
-
class Record2 < Deimos::SchemaClass::Record
|
1059
|
-
|
1060
|
-
### Attribute Accessors ###
|
1061
|
-
# @return [String]
|
1062
|
-
attr_accessor :record2_id
|
1063
|
-
|
1064
|
-
# @override
|
1065
|
-
def initialize(record2_id: "")
|
1066
|
-
super
|
1067
|
-
self.record2_id = record2_id
|
1068
|
-
end
|
1069
|
-
|
1070
|
-
# @override
|
1071
|
-
def schema
|
1072
|
-
'Record2'
|
1073
|
-
end
|
1074
|
-
|
1075
|
-
# @override
|
1076
|
-
def namespace
|
1077
|
-
'com.flipp.content'
|
1078
|
-
end
|
1079
|
-
|
1080
|
-
# @override
|
1081
|
-
def as_json(_opts={})
|
1082
|
-
{
|
1083
|
-
'record2_id' => @record2_id
|
1084
|
-
}
|
1085
|
-
end
|
1086
|
-
end
|
1087
|
-
|
1088
|
-
# Autogenerated Schema for Record at com.flipp.content.Record3
|
1089
|
-
class Record3 < Deimos::SchemaClass::Record
|
1090
|
-
|
1091
|
-
### Attribute Accessors ###
|
1092
|
-
# @return [Float]
|
1093
|
-
attr_accessor :record3_id
|
1094
|
-
|
1095
|
-
# @override
|
1096
|
-
def initialize(record3_id: 0.0)
|
1097
|
-
super
|
1098
|
-
self.record3_id = record3_id
|
1099
|
-
end
|
1100
|
-
|
1101
|
-
# @override
|
1102
|
-
def schema
|
1103
|
-
'Record3'
|
1104
|
-
end
|
1105
|
-
|
1106
|
-
# @override
|
1107
|
-
def namespace
|
1108
|
-
'com.flipp.content'
|
1109
|
-
end
|
1110
|
-
|
1111
|
-
# @override
|
1112
|
-
def as_json(_opts={})
|
1113
|
-
{
|
1114
|
-
'record3_id' => @record3_id
|
1115
|
-
}
|
1116
|
-
end
|
1117
|
-
end
|
1118
|
-
|
1119
|
-
# Autogenerated Schema for Record at com.flipp.content.Record4
|
1120
|
-
class Record4 < Deimos::SchemaClass::Record
|
1121
|
-
|
1122
|
-
### Attribute Accessors ###
|
1123
|
-
# @return [Integer]
|
1124
|
-
attr_accessor :record4_id
|
1125
|
-
|
1126
|
-
# @override
|
1127
|
-
def initialize(record4_id: 0)
|
1128
|
-
super
|
1129
|
-
self.record4_id = record4_id
|
1130
|
-
end
|
1131
|
-
|
1132
|
-
# @override
|
1133
|
-
def schema
|
1134
|
-
'Record4'
|
1135
|
-
end
|
1136
|
-
|
1137
|
-
# @override
|
1138
|
-
def namespace
|
1139
|
-
'com.flipp.content'
|
1140
|
-
end
|
1141
|
-
|
1142
|
-
# @override
|
1143
|
-
def as_json(_opts={})
|
1144
|
-
{
|
1145
|
-
'record4_id' => @record4_id
|
1146
|
-
}
|
1147
|
-
end
|
1148
|
-
end
|
1149
|
-
|
1150
|
-
|
1151
|
-
### Attribute Readers ###
|
1152
|
-
# @return [nil, Record1, Record2, Record3, Record4, Integer, Array<String>]
|
1153
|
-
attr_reader :test_union_type
|
1154
|
-
|
1155
|
-
### Attribute Accessors ###
|
1156
|
-
# @return [String]
|
1157
|
-
attr_accessor :test_id
|
1158
|
-
# @return [nil, Integer]
|
1159
|
-
attr_accessor :test_long
|
1160
|
-
|
1161
|
-
### Attribute Writers ###
|
1162
|
-
# @return [nil, Record1, Record2, Record3, Record4, Integer, Array<String>]
|
1163
|
-
def test_union_type=(value)
|
1164
|
-
@test_union_type = Record1.initialize_from_value(value)
|
1165
|
-
end
|
1166
|
-
|
1167
|
-
# @override
|
1168
|
-
def initialize(test_id: "",
|
1169
|
-
test_long: nil,
|
1170
|
-
test_union_type: nil)
|
1171
|
-
super
|
1172
|
-
self.test_id = test_id
|
1173
|
-
self.test_long = test_long
|
1174
|
-
self.test_union_type = test_union_type
|
1175
|
-
end
|
1176
|
-
|
1177
|
-
# @override
|
1178
|
-
def schema
|
1179
|
-
'MySchemaWithUnionType'
|
1180
|
-
end
|
1181
|
-
|
1182
|
-
# @override
|
1183
|
-
def namespace
|
1184
|
-
'com.my-namespace'
|
1185
|
-
end
|
1186
|
-
|
1187
|
-
# @override
|
1188
|
-
def as_json(_opts={})
|
1189
|
-
{
|
1190
|
-
'test_id' => @test_id,
|
1191
|
-
'test_long' => @test_long,
|
1192
|
-
'test_union_type' => @test_union_type&.as_json
|
1193
|
-
}
|
1194
|
-
end
|
1195
|
-
end
|
1196
|
-
end; end
|
1197
|
-
|
1198
|
-
|
1199
1011
|
spec/app/lib/schema_classes/schemas/my_namespace/my_schema_with_unique_id.rb:
|
1200
1012
|
# frozen_string_literal: true
|
1201
1013
|
|
@@ -1012,63 +1012,6 @@ module Schemas
|
|
1012
1012
|
end
|
1013
1013
|
|
1014
1014
|
|
1015
|
-
spec/app/lib/schema_classes/my_schema_with_union_type.rb:
|
1016
|
-
# frozen_string_literal: true
|
1017
|
-
|
1018
|
-
# This file is autogenerated by Deimos, Do NOT modify
|
1019
|
-
module Schemas
|
1020
|
-
### Primary Schema Class ###
|
1021
|
-
# Autogenerated Schema for Record at com.my-namespace.MySchemaWithUnionType
|
1022
|
-
class MySchemaWithUnionType < Deimos::SchemaClass::Record
|
1023
|
-
|
1024
|
-
### Attribute Readers ###
|
1025
|
-
# @return [nil, Record1, Record2, Record3, Record4, Integer, Array<String>]
|
1026
|
-
attr_reader :test_union_type
|
1027
|
-
|
1028
|
-
### Attribute Accessors ###
|
1029
|
-
# @return [String]
|
1030
|
-
attr_accessor :test_id
|
1031
|
-
# @return [nil, Integer]
|
1032
|
-
attr_accessor :test_long
|
1033
|
-
|
1034
|
-
### Attribute Writers ###
|
1035
|
-
# @return [nil, Record1, Record2, Record3, Record4, Integer, Array<String>]
|
1036
|
-
def test_union_type=(value)
|
1037
|
-
@test_union_type = Record1.initialize_from_value(value)
|
1038
|
-
end
|
1039
|
-
|
1040
|
-
# @override
|
1041
|
-
def initialize(test_id: "",
|
1042
|
-
test_long: nil,
|
1043
|
-
test_union_type: nil)
|
1044
|
-
super
|
1045
|
-
self.test_id = test_id
|
1046
|
-
self.test_long = test_long
|
1047
|
-
self.test_union_type = test_union_type
|
1048
|
-
end
|
1049
|
-
|
1050
|
-
# @override
|
1051
|
-
def schema
|
1052
|
-
'MySchemaWithUnionType'
|
1053
|
-
end
|
1054
|
-
|
1055
|
-
# @override
|
1056
|
-
def namespace
|
1057
|
-
'com.my-namespace'
|
1058
|
-
end
|
1059
|
-
|
1060
|
-
# @override
|
1061
|
-
def as_json(_opts={})
|
1062
|
-
{
|
1063
|
-
'test_id' => @test_id,
|
1064
|
-
'test_long' => @test_long,
|
1065
|
-
'test_union_type' => @test_union_type&.as_json
|
1066
|
-
}
|
1067
|
-
end
|
1068
|
-
end
|
1069
|
-
end
|
1070
|
-
|
1071
|
-
|
1072
1015
|
spec/app/lib/schema_classes/my_schema_with_unique_id.rb:
|
1073
1016
|
# frozen_string_literal: true
|
1074
1017
|
|
@@ -1167,167 +1110,6 @@ module Schemas
|
|
1167
1110
|
end
|
1168
1111
|
|
1169
1112
|
|
1170
|
-
spec/app/lib/schema_classes/record1.rb:
|
1171
|
-
# frozen_string_literal: true
|
1172
|
-
|
1173
|
-
# This file is autogenerated by Deimos, Do NOT modify
|
1174
|
-
module Schemas
|
1175
|
-
### Primary Schema Class ###
|
1176
|
-
# Autogenerated Schema for Record at com.flipp.content.Record1
|
1177
|
-
class Record1 < Deimos::SchemaClass::Record
|
1178
|
-
|
1179
|
-
### Attribute Accessors ###
|
1180
|
-
# @return [Hash<String, Integer>]
|
1181
|
-
attr_accessor :record1_map
|
1182
|
-
# @return [Integer]
|
1183
|
-
attr_accessor :record1_id
|
1184
|
-
|
1185
|
-
# @override
|
1186
|
-
def initialize(record1_map: {},
|
1187
|
-
record1_id: 0)
|
1188
|
-
super
|
1189
|
-
self.record1_map = record1_map
|
1190
|
-
self.record1_id = record1_id
|
1191
|
-
end
|
1192
|
-
|
1193
|
-
# @override
|
1194
|
-
def schema
|
1195
|
-
'Record1'
|
1196
|
-
end
|
1197
|
-
|
1198
|
-
# @override
|
1199
|
-
def namespace
|
1200
|
-
'com.flipp.content'
|
1201
|
-
end
|
1202
|
-
|
1203
|
-
# @override
|
1204
|
-
def as_json(_opts={})
|
1205
|
-
{
|
1206
|
-
'record1_map' => @record1_map,
|
1207
|
-
'record1_id' => @record1_id
|
1208
|
-
}
|
1209
|
-
end
|
1210
|
-
end
|
1211
|
-
end
|
1212
|
-
|
1213
|
-
|
1214
|
-
spec/app/lib/schema_classes/record2.rb:
|
1215
|
-
# frozen_string_literal: true
|
1216
|
-
|
1217
|
-
# This file is autogenerated by Deimos, Do NOT modify
|
1218
|
-
module Schemas
|
1219
|
-
### Primary Schema Class ###
|
1220
|
-
# Autogenerated Schema for Record at com.flipp.content.Record2
|
1221
|
-
class Record2 < Deimos::SchemaClass::Record
|
1222
|
-
|
1223
|
-
### Attribute Accessors ###
|
1224
|
-
# @return [String]
|
1225
|
-
attr_accessor :record2_id
|
1226
|
-
|
1227
|
-
# @override
|
1228
|
-
def initialize(record2_id: "")
|
1229
|
-
super
|
1230
|
-
self.record2_id = record2_id
|
1231
|
-
end
|
1232
|
-
|
1233
|
-
# @override
|
1234
|
-
def schema
|
1235
|
-
'Record2'
|
1236
|
-
end
|
1237
|
-
|
1238
|
-
# @override
|
1239
|
-
def namespace
|
1240
|
-
'com.flipp.content'
|
1241
|
-
end
|
1242
|
-
|
1243
|
-
# @override
|
1244
|
-
def as_json(_opts={})
|
1245
|
-
{
|
1246
|
-
'record2_id' => @record2_id
|
1247
|
-
}
|
1248
|
-
end
|
1249
|
-
end
|
1250
|
-
end
|
1251
|
-
|
1252
|
-
|
1253
|
-
spec/app/lib/schema_classes/record3.rb:
|
1254
|
-
# frozen_string_literal: true
|
1255
|
-
|
1256
|
-
# This file is autogenerated by Deimos, Do NOT modify
|
1257
|
-
module Schemas
|
1258
|
-
### Primary Schema Class ###
|
1259
|
-
# Autogenerated Schema for Record at com.flipp.content.Record3
|
1260
|
-
class Record3 < Deimos::SchemaClass::Record
|
1261
|
-
|
1262
|
-
### Attribute Accessors ###
|
1263
|
-
# @return [Float]
|
1264
|
-
attr_accessor :record3_id
|
1265
|
-
|
1266
|
-
# @override
|
1267
|
-
def initialize(record3_id: 0.0)
|
1268
|
-
super
|
1269
|
-
self.record3_id = record3_id
|
1270
|
-
end
|
1271
|
-
|
1272
|
-
# @override
|
1273
|
-
def schema
|
1274
|
-
'Record3'
|
1275
|
-
end
|
1276
|
-
|
1277
|
-
# @override
|
1278
|
-
def namespace
|
1279
|
-
'com.flipp.content'
|
1280
|
-
end
|
1281
|
-
|
1282
|
-
# @override
|
1283
|
-
def as_json(_opts={})
|
1284
|
-
{
|
1285
|
-
'record3_id' => @record3_id
|
1286
|
-
}
|
1287
|
-
end
|
1288
|
-
end
|
1289
|
-
end
|
1290
|
-
|
1291
|
-
|
1292
|
-
spec/app/lib/schema_classes/record4.rb:
|
1293
|
-
# frozen_string_literal: true
|
1294
|
-
|
1295
|
-
# This file is autogenerated by Deimos, Do NOT modify
|
1296
|
-
module Schemas
|
1297
|
-
### Primary Schema Class ###
|
1298
|
-
# Autogenerated Schema for Record at com.flipp.content.Record4
|
1299
|
-
class Record4 < Deimos::SchemaClass::Record
|
1300
|
-
|
1301
|
-
### Attribute Accessors ###
|
1302
|
-
# @return [Integer]
|
1303
|
-
attr_accessor :record4_id
|
1304
|
-
|
1305
|
-
# @override
|
1306
|
-
def initialize(record4_id: 0)
|
1307
|
-
super
|
1308
|
-
self.record4_id = record4_id
|
1309
|
-
end
|
1310
|
-
|
1311
|
-
# @override
|
1312
|
-
def schema
|
1313
|
-
'Record4'
|
1314
|
-
end
|
1315
|
-
|
1316
|
-
# @override
|
1317
|
-
def namespace
|
1318
|
-
'com.flipp.content'
|
1319
|
-
end
|
1320
|
-
|
1321
|
-
# @override
|
1322
|
-
def as_json(_opts={})
|
1323
|
-
{
|
1324
|
-
'record4_id' => @record4_id
|
1325
|
-
}
|
1326
|
-
end
|
1327
|
-
end
|
1328
|
-
end
|
1329
|
-
|
1330
|
-
|
1331
1113
|
spec/app/lib/schema_classes/update_request.rb:
|
1332
1114
|
# frozen_string_literal: true
|
1333
1115
|
|
@@ -1072,194 +1072,6 @@ module Schemas
|
|
1072
1072
|
end
|
1073
1073
|
|
1074
1074
|
|
1075
|
-
spec/app/lib/schema_classes/my_schema_with_union_type.rb:
|
1076
|
-
# frozen_string_literal: true
|
1077
|
-
|
1078
|
-
# This file is autogenerated by Deimos, Do NOT modify
|
1079
|
-
module Schemas
|
1080
|
-
### Primary Schema Class ###
|
1081
|
-
# Autogenerated Schema for Record at com.my-namespace.MySchemaWithUnionType
|
1082
|
-
class MySchemaWithUnionType < Deimos::SchemaClass::Record
|
1083
|
-
|
1084
|
-
### Secondary Schema Classes ###
|
1085
|
-
# Autogenerated Schema for Record at com.flipp.content.Record1
|
1086
|
-
class Record1 < Deimos::SchemaClass::Record
|
1087
|
-
|
1088
|
-
### Attribute Accessors ###
|
1089
|
-
# @return [Hash<String, Integer>]
|
1090
|
-
attr_accessor :record1_map
|
1091
|
-
# @return [Integer]
|
1092
|
-
attr_accessor :record1_id
|
1093
|
-
|
1094
|
-
# @override
|
1095
|
-
def initialize(record1_map: {},
|
1096
|
-
record1_id: 0)
|
1097
|
-
super
|
1098
|
-
self.record1_map = record1_map
|
1099
|
-
self.record1_id = record1_id
|
1100
|
-
end
|
1101
|
-
|
1102
|
-
# @override
|
1103
|
-
def schema
|
1104
|
-
'Record1'
|
1105
|
-
end
|
1106
|
-
|
1107
|
-
# @override
|
1108
|
-
def namespace
|
1109
|
-
'com.flipp.content'
|
1110
|
-
end
|
1111
|
-
|
1112
|
-
# @override
|
1113
|
-
def as_json(_opts={})
|
1114
|
-
{
|
1115
|
-
'record1_map' => @record1_map,
|
1116
|
-
'record1_id' => @record1_id
|
1117
|
-
}
|
1118
|
-
end
|
1119
|
-
end
|
1120
|
-
|
1121
|
-
# Autogenerated Schema for Record at com.flipp.content.Record2
|
1122
|
-
class Record2 < Deimos::SchemaClass::Record
|
1123
|
-
|
1124
|
-
### Attribute Accessors ###
|
1125
|
-
# @return [String]
|
1126
|
-
attr_accessor :record2_id
|
1127
|
-
|
1128
|
-
# @override
|
1129
|
-
def initialize(record2_id: "")
|
1130
|
-
super
|
1131
|
-
self.record2_id = record2_id
|
1132
|
-
end
|
1133
|
-
|
1134
|
-
# @override
|
1135
|
-
def schema
|
1136
|
-
'Record2'
|
1137
|
-
end
|
1138
|
-
|
1139
|
-
# @override
|
1140
|
-
def namespace
|
1141
|
-
'com.flipp.content'
|
1142
|
-
end
|
1143
|
-
|
1144
|
-
# @override
|
1145
|
-
def as_json(_opts={})
|
1146
|
-
{
|
1147
|
-
'record2_id' => @record2_id
|
1148
|
-
}
|
1149
|
-
end
|
1150
|
-
end
|
1151
|
-
|
1152
|
-
# Autogenerated Schema for Record at com.flipp.content.Record3
|
1153
|
-
class Record3 < Deimos::SchemaClass::Record
|
1154
|
-
|
1155
|
-
### Attribute Accessors ###
|
1156
|
-
# @return [Float]
|
1157
|
-
attr_accessor :record3_id
|
1158
|
-
|
1159
|
-
# @override
|
1160
|
-
def initialize(record3_id: 0.0)
|
1161
|
-
super
|
1162
|
-
self.record3_id = record3_id
|
1163
|
-
end
|
1164
|
-
|
1165
|
-
# @override
|
1166
|
-
def schema
|
1167
|
-
'Record3'
|
1168
|
-
end
|
1169
|
-
|
1170
|
-
# @override
|
1171
|
-
def namespace
|
1172
|
-
'com.flipp.content'
|
1173
|
-
end
|
1174
|
-
|
1175
|
-
# @override
|
1176
|
-
def as_json(_opts={})
|
1177
|
-
{
|
1178
|
-
'record3_id' => @record3_id
|
1179
|
-
}
|
1180
|
-
end
|
1181
|
-
end
|
1182
|
-
|
1183
|
-
# Autogenerated Schema for Record at com.flipp.content.Record4
|
1184
|
-
class Record4 < Deimos::SchemaClass::Record
|
1185
|
-
|
1186
|
-
### Attribute Accessors ###
|
1187
|
-
# @return [Integer]
|
1188
|
-
attr_accessor :record4_id
|
1189
|
-
|
1190
|
-
# @override
|
1191
|
-
def initialize(record4_id: 0)
|
1192
|
-
super
|
1193
|
-
self.record4_id = record4_id
|
1194
|
-
end
|
1195
|
-
|
1196
|
-
# @override
|
1197
|
-
def schema
|
1198
|
-
'Record4'
|
1199
|
-
end
|
1200
|
-
|
1201
|
-
# @override
|
1202
|
-
def namespace
|
1203
|
-
'com.flipp.content'
|
1204
|
-
end
|
1205
|
-
|
1206
|
-
# @override
|
1207
|
-
def as_json(_opts={})
|
1208
|
-
{
|
1209
|
-
'record4_id' => @record4_id
|
1210
|
-
}
|
1211
|
-
end
|
1212
|
-
end
|
1213
|
-
|
1214
|
-
|
1215
|
-
### Attribute Readers ###
|
1216
|
-
# @return [nil, Record1, Record2, Record3, Record4, Integer, Array<String>]
|
1217
|
-
attr_reader :test_union_type
|
1218
|
-
|
1219
|
-
### Attribute Accessors ###
|
1220
|
-
# @return [String]
|
1221
|
-
attr_accessor :test_id
|
1222
|
-
# @return [nil, Integer]
|
1223
|
-
attr_accessor :test_long
|
1224
|
-
|
1225
|
-
### Attribute Writers ###
|
1226
|
-
# @return [nil, Record1, Record2, Record3, Record4, Integer, Array<String>]
|
1227
|
-
def test_union_type=(value)
|
1228
|
-
@test_union_type = Record1.initialize_from_value(value)
|
1229
|
-
end
|
1230
|
-
|
1231
|
-
# @override
|
1232
|
-
def initialize(test_id: "",
|
1233
|
-
test_long: nil,
|
1234
|
-
test_union_type: nil)
|
1235
|
-
super
|
1236
|
-
self.test_id = test_id
|
1237
|
-
self.test_long = test_long
|
1238
|
-
self.test_union_type = test_union_type
|
1239
|
-
end
|
1240
|
-
|
1241
|
-
# @override
|
1242
|
-
def schema
|
1243
|
-
'MySchemaWithUnionType'
|
1244
|
-
end
|
1245
|
-
|
1246
|
-
# @override
|
1247
|
-
def namespace
|
1248
|
-
'com.my-namespace'
|
1249
|
-
end
|
1250
|
-
|
1251
|
-
# @override
|
1252
|
-
def as_json(_opts={})
|
1253
|
-
{
|
1254
|
-
'test_id' => @test_id,
|
1255
|
-
'test_long' => @test_long,
|
1256
|
-
'test_union_type' => @test_union_type&.as_json
|
1257
|
-
}
|
1258
|
-
end
|
1259
|
-
end
|
1260
|
-
end
|
1261
|
-
|
1262
|
-
|
1263
1075
|
spec/app/lib/schema_classes/my_schema_with_unique_id.rb:
|
1264
1076
|
# frozen_string_literal: true
|
1265
1077
|
|
data/spec/spec_helper.rb
CHANGED
@@ -276,31 +276,6 @@ RSpec.shared_context('with widgets') do
|
|
276
276
|
end
|
277
277
|
end
|
278
278
|
|
279
|
-
RSpec.shared_context('with widget_with_union_types') do
|
280
|
-
before(:all) do
|
281
|
-
ActiveRecord::Base.connection.create_table(:widget_with_union_types, force: true) do |t|
|
282
|
-
t.string(:test_id)
|
283
|
-
t.bigint(:test_long)
|
284
|
-
t.json(:test_union_type)
|
285
|
-
|
286
|
-
t.timestamps
|
287
|
-
end
|
288
|
-
|
289
|
-
# :nodoc:
|
290
|
-
class WidgetWithUnionType < ActiveRecord::Base
|
291
|
-
# @return [String]
|
292
|
-
def generated_id
|
293
|
-
'generated_id'
|
294
|
-
end
|
295
|
-
end
|
296
|
-
end
|
297
|
-
|
298
|
-
after(:all) do
|
299
|
-
ActiveRecord::Base.connection.drop_table(:widget_with_union_types)
|
300
|
-
end
|
301
|
-
end
|
302
|
-
|
303
|
-
|
304
279
|
RSpec.shared_context('with DB') do
|
305
280
|
before(:all) do
|
306
281
|
setup_db(self.class.metadata[:db_config] || DbConfigs::DB_OPTIONS.last)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deimos-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Orner
|
@@ -418,6 +418,7 @@ files:
|
|
418
418
|
- ".ruby-version"
|
419
419
|
- ".tool-versions"
|
420
420
|
- CHANGELOG.md
|
421
|
+
- CHANGELOG.md.orig
|
421
422
|
- CODE_OF_CONDUCT.md
|
422
423
|
- Dockerfile
|
423
424
|
- Gemfile
|
@@ -567,7 +568,6 @@ files:
|
|
567
568
|
- spec/schemas/com/my-namespace/MySchemaWithDateTimes.avsc
|
568
569
|
- spec/schemas/com/my-namespace/MySchemaWithId.avsc
|
569
570
|
- spec/schemas/com/my-namespace/MySchemaWithTitle.avsc
|
570
|
-
- spec/schemas/com/my-namespace/MySchemaWithUnionType.avsc
|
571
571
|
- spec/schemas/com/my-namespace/MySchemaWithUniqueId.avsc
|
572
572
|
- spec/schemas/com/my-namespace/MySchema_key.avsc
|
573
573
|
- spec/schemas/com/my-namespace/Wibble.avsc
|
@@ -592,7 +592,6 @@ files:
|
|
592
592
|
- spec/schemas/my_namespace/my_schema_with_complex_type.rb
|
593
593
|
- spec/schemas/my_namespace/my_schema_with_date_time.rb
|
594
594
|
- spec/schemas/my_namespace/my_schema_with_id.rb
|
595
|
-
- spec/schemas/my_namespace/my_schema_with_union_type.rb
|
596
595
|
- spec/schemas/my_namespace/my_schema_with_unique_id.rb
|
597
596
|
- spec/schemas/my_namespace/my_updated_schema.rb
|
598
597
|
- spec/schemas/my_namespace/request/create_topic.rb
|
@@ -696,7 +695,6 @@ test_files:
|
|
696
695
|
- spec/schemas/com/my-namespace/MySchemaWithDateTimes.avsc
|
697
696
|
- spec/schemas/com/my-namespace/MySchemaWithId.avsc
|
698
697
|
- spec/schemas/com/my-namespace/MySchemaWithTitle.avsc
|
699
|
-
- spec/schemas/com/my-namespace/MySchemaWithUnionType.avsc
|
700
698
|
- spec/schemas/com/my-namespace/MySchemaWithUniqueId.avsc
|
701
699
|
- spec/schemas/com/my-namespace/MySchema_key.avsc
|
702
700
|
- spec/schemas/com/my-namespace/Wibble.avsc
|
@@ -721,7 +719,6 @@ test_files:
|
|
721
719
|
- spec/schemas/my_namespace/my_schema_with_complex_type.rb
|
722
720
|
- spec/schemas/my_namespace/my_schema_with_date_time.rb
|
723
721
|
- spec/schemas/my_namespace/my_schema_with_id.rb
|
724
|
-
- spec/schemas/my_namespace/my_schema_with_union_type.rb
|
725
722
|
- spec/schemas/my_namespace/my_schema_with_unique_id.rb
|
726
723
|
- spec/schemas/my_namespace/my_updated_schema.rb
|
727
724
|
- spec/schemas/my_namespace/request/create_topic.rb
|