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

[BUGFIX beta] Fix resetting of properties to in-flight values #4379

Merged
merged 1 commit into from
May 12, 2016

Conversation

courajs
Copy link
Contributor

@courajs courajs commented May 10, 2016

Changing the value of an in-flight property, then changing back, had the
side effect that the record would be marked dirty once the save
completed.

changedAttributes would report that name had been changed from
'Thomas' to 'Thomas'

This is because the attr computed was only checking to see if the value
was being reset to the canonical value, not if it was being reset to the
in-flight value

@courajs
Copy link
Contributor Author

courajs commented May 10, 2016

Dug up while working on #4246

assert.equal(person.get('name'), "Tomathy");

person.set('name', 'Thomas');
assert.equal(person.get('name'), "Thomas");
Copy link
Contributor Author

@courajs courajs May 10, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without these 4 lines 131-135, this test passed without code changes. Changing name, and then changing it back, put the record in a bad state.

Changing the value of an in-flight property, then changing back, had the
side effect that the record would be marked dirty once the save
completed.

`changedAttributes` would report that `name` had been changed from
'Thomas' to 'Thomas'

This is because the attr computed was only checking to see if the value
was being reset to the canonical value, not if it was being reset to the
in-flight value
@courajs courajs force-pushed the reset-to-inflight-value branch from b729405 to 8046c48 Compare May 10, 2016 16:16
@bmac bmac merged commit b9e28d4 into emberjs:master May 12, 2016
@bmac
Copy link
Member

bmac commented May 12, 2016

Thanks @courajs.

@courajs courajs deleted the reset-to-inflight-value branch May 12, 2016 13:35
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

Successfully merging this pull request may close these issues.

2 participants