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

Does not work with ember data models with more than one attr #407

Closed
luketheobscure opened this issue Jan 14, 2020 · 4 comments
Closed

Does not work with ember data models with more than one attr #407

luketheobscure opened this issue Jan 14, 2020 · 4 comments

Comments

@luketheobscure
Copy link
Contributor

Version

3.0.0-beta.9

Test Case

#406

Steps to reproduce

Attempts to work with a changeset for an ember data model with more than one attr fails when it tries to commit the changes.

It appears to be a bug somewhere inside buildPathToValue. Given a simple model like {foo: 1, bar: 2} it will attempt to set a value at foo.bar.

Expected Behavior

Saving models with more than one attr should not throw errors.

Actual Behavior

Models should save. ;)

@luketheobscure
Copy link
Contributor Author

It looks like it boils down to unexpected behavior when checking foo.hasOwnProperty(key).

Screen Shot 2020-01-14 at 2 54 09 PM

@luketheobscure
Copy link
Contributor Author

luketheobscure commented Jan 14, 2020

I was able to fix it, but I'm not sure it's the ideal solution: 6170b40

Edit: Spoke to soon. Adding a relationship to that model will result in the same kind of bug.

@luketheobscure
Copy link
Contributor Author

PR now has fixes for all the scenarios I found.

@luketheobscure
Copy link
Contributor Author

Fixed by #406

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

1 participant