Assigning to a belongs_to association overwrites fields in previous association target

XMLWordPrintableJSON

    • None
    • None
    • None
    • None
    • None
    • None

      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
              Reporter:
              Intrepidd [X]
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: