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

Setting nil on an existing belongs_to relation deletes the object

    • Type: Icon: Task Task
    • Resolution: Done
    • 2.1.9
    • Affects Version/s: None
    • Component/s: None

      I just set a belongs_to relation to nil which deleted the related object. Is this the desired behavior?

      1. e.g this deletes the user object
        listing.user => # an existing user
        listing.user = nil

      Shouldn't this just clear the relationship, setting listing.user_id to nil?

      I'm using 2.1.7

            Assignee:
            Unassigned Unassigned
            Reporter:
            christospappas Christos Pappas
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: