Skip to content

change(model): setDataValue shouldn't set attribute as changed when u… - #9347

Merged
sushantdhiman merged 2 commits into
sequelize:masterfrom
maayanHo:master
Apr 29, 2018
Merged

change(model): setDataValue shouldn't set attribute as changed when u…#9347
sushantdhiman merged 2 commits into
sequelize:masterfrom
maayanHo:master

Conversation

@maayanHo

@maayanHo maayanHo commented Apr 24, 2018

Copy link
Copy Markdown
Contributor

…pdated from null to null #5004

Pull Request check-list

Please make sure to review and check all of these items:

  • Does npm run test or npm run test-DIALECT pass with this change (including linting)?
  • Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Have you added new tests to prevent regressions?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Did you follow the commit message conventions explained in CONTRIBUTING.md?

Description of change

@codecov

codecov Bot commented Apr 24, 2018

Copy link
Copy Markdown

Codecov Report

Merging #9347 into master will increase coverage by 7.01%.
The diff coverage is 100%.

@Kirill89

Copy link
Copy Markdown
Contributor

@sushantdhiman, can you please take a look?

@eseliger
eseliger requested review from a team and sushantdhiman April 29, 2018 02:12

@sushantdhiman sushantdhiman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

New test should be using .set not .setDataValue

@Kirill89

Copy link
Copy Markdown
Contributor

@sushantdhiman, but we are checking functionality of .setDataValue. Should we create a model with custom setter and use .setDataValue there?

@sushantdhiman sushantdhiman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I see there is already a test for .set primitive null case.

Just move this test under new describe and rebase your branch with master. Then it should be good to go

Comment thread test/unit/instance/changed.test.js Outdated
expect(user.changed('meta')).to.equal(false);
});

it('should return falsy for unchanged primitive via setDataValue', function() {

@sushantdhiman sushantdhiman Apr 29, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

move this one new test under describe('setDataValue'), as it's testing setDataValue

@sushantdhiman
sushantdhiman merged commit 780f7c0 into sequelize:master Apr 29, 2018
davegw added a commit to davegw/sequelize that referenced this pull request Jan 3, 2019
davegw added a commit to davegw/sequelize that referenced this pull request Jan 4, 2019
@davegw davegw mentioned this pull request Jan 4, 2019
5 tasks
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.

4 participants