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

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

Merged
merged 2 commits into from Apr 29, 2018

Conversation

maayanHo
Copy link
Contributor

@maayanHo maayanHo commented Apr 24, 2018

…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
Copy link

codecov bot commented Apr 24, 2018

Codecov Report

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

@Kirill89
Copy link
Contributor

@sushantdhiman, can you please take a look?

Copy link
Contributor

@sushantdhiman sushantdhiman left a comment

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
Contributor

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

Copy link
Contributor

@sushantdhiman sushantdhiman left a comment

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

@@ -47,6 +47,21 @@ describe(Support.getTestDialectTeaser('Instance'), () => {
expect(user.changed('meta')).to.equal(false);
});

it('should return falsy for unchanged primitive via setDataValue', function() {
Copy link
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.

None yet

4 participants