Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-737

Update #select and #reject methods in classes that inherit Hash

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.10.0
    • Affects Version/s: None
    • Component/s: None
    • None

      In Ruby 2.1.1, there is a regression in Hash#reject. It accidentally returns a plain Hash object, not an object of the inherited class.

      See the blog post: https://www.ruby-lang.org/en/news/2014/03/10/regression-of-hash-reject-in-ruby-2-1-1/

      We need to do three things:
      1) Add a select method in OrderedHash to account for this. We already have a reject method that avoids this problem.
      2) Add #select and #reject methods to the class HashWithIndifferentAccess to match what Rails core did. https://github.com/rails/rails/commit/af39f5871094d8c241103182edebedbb26e31d4c

            Assignee:
            samantha.ritter@mongodb.com Samantha Ritter (Inactive)
            Reporter:
            emily.stolfo Emily Stolfo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: