Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-5267

Remove driver argument in Queryable constructor

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 8.0.1
    • Affects Version/s: None
    • Component/s: None
    • Minor Change

      Queryable constructor has this driver argument:

            # @param [ Symbol ] driver The driver being used.
            def initialize(aliases = {}, serializers = {}, relations = {}, driver = :mongo)
      

      This is used in one place as far as I can tell:

              def add_sort_option(options, field, direction)
                if driver == :mongo1x
                  sorting = (options[:sort] || []).dup
                  sorting.push([ field, direction ])
                  options.store(:sort, sorting)
                else
                  sorting = (options[:sort] || {}).dup
                  sorting[field] = direction
                  options.store(:sort, sorting)
                end
              end
      

      This argument is not documented and I don't see how a user would actually set it, since it's defined in an internal constructor that is not directly exposed to applications. Additionally, we haven't supported the 1.x driver for a long time.

      I suggest removing this argument entirely for 8.0.

            Assignee:
            neil.shweky@mongodb.com Neil Shweky (Inactive)
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: