Skip to main content

Module serialization

Module serialization 

Source
Expand description

Model serialization helpers: as_json with only/except filtering (Rails as_json(only:/except:)) and serialized columns (store a struct as JSON text).

Functionsยง

as_json
Serialize a value to a JSON Value (null on failure).
as_json_except
Serialize dropping the listed top-level keys (Rails as_json(except:)).
as_json_only
Serialize keeping only the listed top-level keys (Rails as_json(only:)).
deserialize_column
Deserialize a value previously stored by serialize_column.
serialize_column
Serialize a value to a JSON string for storage in a text/JSON column.