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

ArgumentError when scope block has positional and keyword arguments

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.0.2, 7.5.1
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible

      When a scope has positional and keyword arguments on Ruby 3.0 or later, it raises ArgumentError.

      scope :name_by, ->(name, deleted: false) {where(name: name, deleted: deleted)} 

      This is due to a breaking change in the keyword argument in Ruby 3.0.

      https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/

            Assignee:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            claddvd@gmail.com YOSHIDA Katsuhiko
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: