"delegate" is broken when using Rails

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: 7.1.0
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Starting with version 7.1.0, MongoID models can no longer utilize Rails' delegate method. Attempting to call the method results in an ArgumentError.

      I inspected this issue a little further and it turned out that delegate no longer refers to the Rails' method but to Ruby's built-in Forwardable module.

      Rails' Module#delegate and Ruby's Forwardable#delegate have different semantics and cannot be used interchangeably.

      If I'm not mistaken, this is due to https://github.com/mongodb/mongoid/commit/3cfabfd2e41c8e3738aa6e381b9113d89275f2f5 which added the Forwardable module to MongoID.

              Assignee:
              Oleg Pudeyev (Inactive)
              Reporter:
              Stefan Schüßler
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: