Skip to content
This repository was archived by the owner on Jul 7, 2026. It is now read-only.
This repository was archived by the owner on Jul 7, 2026. It is now read-only.

Better support for model.save with partial setting of nested attributes #143

Description

@ambischof

Lets say we have the following user:

bob = new MyModel({
   name: {
       first: 'bob',
       middle: 'bill',
       last: 'smith'
   }
})

if you do bob.set({name.first: "Bob"}) you'd get

{
   name: {
       first: 'Bob',
       middle: 'bill',
       last: 'smith'
   }
}

but if you try to do bob.save({'name.first': "Bob"}) you would get

{
   'name.first': 'Bob',
   name: {
       first: 'bob',
       middle: 'bill',
       last: 'smith'
   }
}

In order to avoid unintended consequences, there should be some mechanism to use save the same way you would use set.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions