Skip to content

Attr default value can be modified by reference #1868

@Graphmaxer

Description

@Graphmaxer

Environment

No response

Reproduction

  • Create a model with a field this.attr(() => ({}), for example: parameters: this.attr(() => {}),
  • Create a new instance of this model and add an attribute to this value, for example: 'model.parameters.a = 1;`
  • All new instances of this model will have this new attribute a inside parameters by default

Describe the bug

The attr field type should create a copy of the default value to avoid modifying it by reference

Additional context

No response

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions