-
Type: Improvement
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: Docs
-
Fully Compatible
The custom fields documentation (https://www.mongodb.com/docs/mongoid/master/reference/fields/#custom-field-types) currently only gives an example of a "real" field, where the value being stored is of the declared type.
Another use case of custom field types is a "phantom" one, where the field type defines mongoize/demongoize/evolve methods that convert from one type of value to another, and neither of these value types is the instance of the field type class itself. For example, this can be used to implement enums where the set of values in the application is different (e.g. more verbose/descriptive) than the set of values in the database.
- related to
-
MONGOID-5409 Move field type protocol to dedicated classes
- Backlog
- links to