-
Type: Improvement
-
Resolution: Won't Do
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
PR: https://github.com/mongodb/mongoid/pull/5121
Mongoid already supports defining field :type as a Symbol instead of a Class
field :first_name, type: :string # works today
However, currently the docs, etc. recommend to use a Class. Generally speaking, it is much better to to use Symbol than Class, because Class uses autoloading etc.
I'd like to propose the following:
- Deprecate (warn) using field :type as a Class
- Remove class usage entirely in Mongoid 8.0.
- Add ability to define custom field type Symbols
- is duplicated by
-
MONGOID-5184 field "type" parameter should use a symbol arg instead of a class
- Closed
- is related to
-
MONGOID-5327 Prohibit using undefined string/symbol types when declaring fields
- Closed
-
MONGOID-5336 Allow user-defined symbol/string field types
- Backlog
-
MONGOID-5326 Document specifying field types as strings/symbols
- Closed
- related to
-
MONGOID-5409 Move field type protocol to dedicated classes
- Backlog