Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Unable to set deep objects to models without mutators #34

Closed
84564221 opened this issue Jan 1, 2015 · 1 comment
Closed

Bug: Unable to set deep objects to models without mutators #34

84564221 opened this issue Jan 1, 2015 · 1 comment

Comments

@84564221
Copy link
Contributor

84564221 commented Jan 1, 2015

You can not set deep objects to models without any mutators.

Example (data recieved from a form):

formData = {
  name: "Batman",
  car: "Batmobile",
  engine: "Jet Turbine",
  enemies: ["Godzilla", "Rodan", "Mothra", "Gorosaurus"],
  location: {
    atHome: false,
    inCave: true
  }
  ...
};

model.set(formData);

Error message:

Line 138: TypeError: can't convert key to string

The only solution is to change/undeclare the mutators:{} property to mutators: undefined in the model. Not that clean.

@84564221 84564221 changed the title Bug: Unable to set deep objects with data to models without mutators Bug: Unable to set deep objects to models without mutators Jan 1, 2015
@asciidisco
Copy link
Owner

Merged & released in v 0.4.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants