flipp-oss / deimos

Framework to work with Kafka, Avro and ActiveRecord
Other
59 stars 22 forks source link

ActiveRecordGenerator does not handle records that are inside of a Union #123

Open DeeChau opened 3 years ago

DeeChau commented 3 years ago

Usually fields of type "record" are stored as t.json for active-record.

The following is is not handled correctly for the Deimos::Generators::ActiveRecordGenerator e.g. in Generated.avsc

{
  "name": "an_optional_record",
  "doc": "an optional record",
  "type": [ "null", "ARecord" ],
  "default": null
}

And it generates as: t.string :an_optional_record rather than t.json :an_optional_record.