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

Comments

Failing tests for previousAttributes/rollbackAttributes#133

Merged
pixelhandler merged 1 commit intopixelhandler:masterfrom
realityendshere:pr/test-multiple-changes-to-an-attribute
Jan 13, 2017
Merged

Failing tests for previousAttributes/rollbackAttributes#133
pixelhandler merged 1 commit intopixelhandler:masterfrom
realityendshere:pr/test-multiple-changes-to-an-attribute

Conversation

@realityendshere
Copy link
Contributor

@realityendshere realityendshere commented Jan 12, 2017

Current behavior is to stash an attribute’s value on EVERY call to .set(). The intent seems to be to rollback to the value fetched from the persistence layer.

As illustrated by the tests:

post.get(‘excerpt’); // ‘Was a gambler.’

post.set('excerpt', 'Became the sheriff.');
post.set('excerpt', 'Became the chief.');
post.set('excerpt', 'Became the mayor.');

post.get('previousAttributes.excerpt’); // 'Became the chief.'

The previous value is simply the previous change ('Became the chief’) instead of the “original” value (“Was a gambler”).

The new tests FAIL to show that “previousAttributes” and “rollbackAttributes” to not behave as expected.

…rollbackAttributes

Current behavior is to stash an attribute’s value on EVERY call to .set(). The intent seems to be to rollback to the value fetched from the persistence layer.

As illustrated by the tests:

```
post.get(‘excerpt’); // ‘Was a gambler.’

post.set('excerpt', 'Became the sheriff.');
post.set('excerpt', 'Became the chief.');
post.set('excerpt', 'Became the mayor.');

post.get('previousAttributes.excerpt’); // 'Became the chief.'
```

The previous value is simply the previous change ('Became the chief’) instead of the “original” value (“Was a gambler”).

The new tests FAIL to show that “previousAttributes” and “rollbackAttributes” to not behave as expected.
@realityendshere realityendshere force-pushed the pr/test-multiple-changes-to-an-attribute branch from 504eeec to 1c8a7db Compare January 12, 2017 02:34
@pixelhandler pixelhandler changed the title Add failing tests for previousAttributes and… Failing tests for previousAttributes/rollbackAttributes Jan 13, 2017
@pixelhandler pixelhandler merged commit d1641c1 into pixelhandler:master Jan 13, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants