Object#=~ removed in Ruby 3.2

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Unknown
    • 9.0.10
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • Ruby Drivers
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      Comment from a closed PR - https://github.com/mongodb/mongoid/pull/5559#pullrequestreview-2911030364

      Object#=~ was removed in Ruby 3.2

      The value param is now marked as type Object, should the code below call #to_s on these now?

              when Regexp
                value =~ condition
              when ::BSON::Regexp::Raw
                value =~ condition.compile
      

      I have a codebase where value is an array that is now raising a NoMethodError with Ruby 3.2+ (see https://github.com/mongodb/mongoid/pull/5559/files/42769904eea2f5c07aa152bdeceeb7d54d104a8d#diff-66d1be12f385ecc4caaf995886fda1894a24281fa834399a8a0b4ae7946bc772)

            Assignee:
            Kyle Burgess
            Reporter:
            Alex Bevilacqua
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: