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

Copyable can modify program behavior at runtime

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: 5.0.0
    • Fix Version/s: 6.0.0
    • Component/s: None
    • Labels:
    • Sprint:
      Ruby Sprint 35

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: