Prefer symbol field types over class ones

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Won't Do
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • 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:

      1. Deprecate (warn) using field :type as a Class
      2. Remove class usage entirely in Mongoid 8.0.
      3. Add ability to define custom field type Symbols

              Assignee:
              Oleg Pudeyev (Inactive)
              Reporter:
              Johnny Shields
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: