BSON::Document#fetch does not conform to Hash#fetch API

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Critical - P2
    • bson-4.4.2
    • Affects Version/s: bson-4.4.1
    • Component/s: BSON
    • Environment:
      Any
    • 1
    • None
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None

      Hello!

      After update to ~> 4.4.0 (couldn't set the affect version unfortunately), using fetch on BSON::Document objects might fail - new fetch definition which overshadows Hash one has different set of arguments:

      bson-ruby

      https://github.com/mongodb/bson-ruby/blob/v4.4.1/lib/bson/document.rb#L50-L53

      fetch(key)

      ruby core

      https://ruby-doc.org/core-2.5.1/Hash.html#method-i-fetch
       
      fetch(key [, default] ) → obj
      fetch(key) {| key | block } → obj
       
      Best,
      Michał
       

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

                Created:
                Updated:
                Resolved: