@@ -91,6 +91,7 @@ It also changes the behavior of values passed to `ActiveRecord::Base.where`, whi
9191without having to rely on implementation details or monkey patching.
9292
9393Some things that you can achieve with this:
94+
9495* The type detected by Active Record can be overridden.
9596* A default can also be provided.
9697* Attributes do not need to be backed by a database column.
@@ -131,16 +132,16 @@ model.attributes #=> {field_without_db_column: [1, 2, 3]}
131132** Creating Custom Types:**
132133
133134You can define your own custom types, as long as they respond
134- to the methods defined on the value type. The method + deserialize+ or
135- + cast+ will be called on your type object, with raw input from the
135+ to the methods defined on the value type. The method ` deserialize ` or
136+ ` cast ` will be called on your type object, with raw input from the
136137database or from your controllers. This is useful, for example, when doing custom conversion,
137138like Money data.
138139
139140** Querying:**
140141
141142When ` ActiveRecord::Base.where ` is called, it will
142143use the type defined by the model class to convert the value to SQL,
143- calling + serialize+ on your type object.
144+ calling ` serialize ` on your type object.
144145
145146This gives the objects ability to specify, how to convert values when performing SQL queries.
146147
0 commit comments