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

Assigning to a belongs_to association overwrites fields in previous association target

      I've set up a repository to describe this behavior : https://github.com/Intrepidd/mongoid-bug-assignation

      It seems that when retrieving a relationship object, a reference to it is conserved internally, and updated when the reference itself is updated.

      It's very dangerous as local variables can have their content changed and is extremely difficult to debug.

      Is this a known and wanted behavior ?

      Thanks

            Assignee:
            Unassigned Unassigned
            Reporter:
            Intrepidd Intrepidd [X]
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: