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

Copyable can modify program behavior at runtime

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 6.0.0
    • Affects Version/s: 5.0.0
    • Component/s: 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 Emily Stolfo
            Reporter:
            tzar Tapio Saarinen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: