rom-rb / rom

Data mapping and persistence toolkit for Ruby
https://rom-rb.org
MIT License
2.08k stars 161 forks source link

Instantiating a custom Struct #489

Closed joelvh closed 6 years ago

joelvh commented 6 years ago

I have an Events relation that defines a schema. I've configured it to use the Event struct, which inherits from ROM::Struct. How can I instantiate a new Event to use the create command and insert new records into my dataset? Do I have to define the attributes on the custom struct? What if I'm trying to take advantage of the infer: true option?

Thanks.

joelvh commented 6 years ago

Posted to Discourse: https://discourse.rom-rb.org/t/instantiating-a-custom-struct-instance/224/1