lib/avromatic/model/raw_serialization.rb in avromatic-2.2.6 vs lib/avromatic/model/raw_serialization.rb in avromatic-2.3.0

- old
+ new

@@ -79,11 +79,11 @@ # schema for the corresponding value. The model's schemas are always used # as the reader's schemas. def avro_raw_decode(key: nil, value:, key_schema: nil, value_schema: nil) key_attributes = key && decode_avro_datum(key, key_schema, :key) value_attributes = decode_avro_datum(value, value_schema, :value) - - new(value_attributes.merge!(key_attributes || {})) + value_attributes.merge!(key_attributes) if key_attributes + new(value_attributes) end private def decode_avro_datum(data, schema = nil, key_or_value = :value)