Open szechyjs opened 1 year ago
Thanks for opening this. Can you provide the model class code you're using?
Are you looking for the save_values
method? It applies serialization to all of the attributes and returns a hash. (Note though that it ALSO translate the attribute names into their database names).
It would be nice if there was an easy way to serialize a record to JSON with the type conversions/marshaling.
The
to_h
method isn't sufficient as it just uses the raw values.A
to_json
method would be ideal, but a method to get a type castedHash
would be sufficient.