Allow for schemaless schemas - ie schemas that are just the tuple based representation.
~This should be relatively simple.~
The tricky bit is how to allow for inline schemas that have has_many / has_one. The syntax is not particularly nice and we need a way to provide a data_accessor. Arguably it should use the data accessor of the "parent" - ie the accessor that is passed in when call to_struct initially.
Lots of branching options here... because the number of ways you can provide a struct is... a lot.
I like the idea of being able to turn some data into an existing struct without having to add code into that struct's module - like a data_accessor. That would allow for one struct to work in many different schemas.
Allow for schemaless schemas - ie schemas that are just the tuple based representation.
~This should be relatively simple.~
The tricky bit is how to allow for inline schemas that have
has_many
/has_one
. The syntax is not particularly nice and we need a way to provide a data_accessor. Arguably it should use the data accessor of the "parent" - ie the accessor that is passed in when callto_struct
initially.Lots of branching options here... because the number of ways you can provide a struct is... a lot.
I like the idea of being able to turn some data into an existing struct without having to add code into that struct's module - like a data_accessor. That would allow for one struct to work in many different schemas.