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

document.to_key returns array instead of string

    • Type: Icon: Bug Bug
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 8.0.3
    • Component/s: None

      # Return the key value for the document.
      #
      # @exampleReturn the key.
      # document.to_key
      #
      # @return [ String ] The id of the document or nil if new.
      def to_key
        (persisted? || destroyed?) ? [ _id.to_s ] : nil
      end
      

       

      this eg breaks devise passwordless when find_by(_id: resource.to_key) is called (which works on ActiveRecord resources)

            Assignee:
            Unassigned Unassigned
            Reporter:
            andreas@ulrich.com.de Andreas Ulrich
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: