Copyable can modify program behavior at runtime

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • 6.0.0
    • Affects Version/s: 5.0.0
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None

      https://github.com/mongodb/mongoid/blob/dffa8432436f05c611eb857fc014af44401c6b2a/lib/mongoid/copyable.rb#L28

      This commit was introduced to fix behavior around extra attributes on documents and cloning (something our team had previously patched for 4.x).

      It includes `Attributes::Dynamic` as part of the `clone` method - meaning that the behavior of the class could change totally based on whether or not a document has been cloned yet. As a result it breaks expectations about what should not be allowed on the class, and is probably quite slow as it would force a method cache clear.

            Assignee:
            Emily Stolfo (Inactive)
            Reporter:
            Tapio Saarinen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: