class Jennifer::Model::JSONSerializableConverter(T)
- Jennifer::Model::JSONSerializableConverter(T)
- Reference
- Object
Overview
Allows to serialize/deserialize JSON column to/from T.
class Location
include JSON::Serializable
property latitude : Float64
property longitude : Float64
end
class User < Jennifer::Model::Base
mapping(
# ...
location: {type: Location, converter: Jennifer::Model::JSONSerializableConverter(Location)}
)
end
Defined in:
jennifer/model/json_serializable_converter.crClass Method Summary
- .from_db(pull, options)
- .from_hash(hash : Hash, column, options)
- .to_db(value : Nil, options) : Nil
- .to_db(value : T, options) : String