master:fix-previous-value#7189
Conversation
sushantdhiman
left a comment
There was a problem hiding this comment.
Needs changelog, otherwise LGTM
88437a7 to
4dc66ef
Compare
Codecov ReportContinue to review full report at Codecov.
|
|
@sushantdhiman , added |
test/unit/instance/previous.test.js
Outdated
| , DataTypes = require(__dirname + '/../../../lib/data-types') | ||
| , current = Support.sequelize; | ||
|
|
||
| describe(Support.getTestDialectTeaser('Instance'), function() { |
There was a problem hiding this comment.
Space before opening brackets function ()
4dc66ef to
09804cc
Compare
|
done |
|
This fix broke our application :D |
|
Previous function doesn't return the correct values now, instance.dataValues override with the new values in Utils._.extend(instance.dataValues, values); the _previousDataValues overrided with same new data value |
|
@barriber so actually we also have to change that code which sets dataValues directly I guess, into something like: in order to guarantee the same data flow into the instance |
|
@janmeier could you please comment if this is the correct solution? |
|
@barriber i see that there is a note in |
| @@ -2977,11 +2977,12 @@ class Model { | |||
| * @param {any} value | |||
| */ | |||
| setDataValue(key, value) { | |||
There was a problem hiding this comment.
This does't work if you call setDataValue multiple times... previous should return the original value (ie. the value in the DB when the record was fetched), am I wrong?
There was a problem hiding this comment.
Ok that was reverted... sorry ^^
Pull Request check-list
npm run testornpm run test-DIALECTpass with this change (including linting)?Futurein the changelog?Description of change
Previous method of the instance was working incorrectly