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

fix(model/upsert): Made the validation flag work for upserts #8872

Merged
merged 5 commits into from
Feb 27, 2018

Conversation

aceew
Copy link
Contributor

@aceew aceew commented Jan 10, 2018

Added:

  • Check on options.validate before choosing to validate the instance in: lib/model.js

Pull Request check-list

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

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

Description of change

validate flag did nothing on model upserts meaning validations would always be run. This PR resolves this by wrapping the model validations in a condition the same way done so for Model.create

Added:
 - Check on options.validate before choosing to validate the instance in: lib/model.js
@aceew aceew closed this Jan 10, 2018
@aceew aceew reopened this Feb 27, 2018
Test was checking for created === true, when sqlite returns undefined instead of true
@codecov
Copy link

codecov bot commented Feb 27, 2018

Codecov Report

Merging #8872 into master will increase coverage by <.01%.
The diff coverage is 100%.

if (dialect === 'sqlite') {
expect(created).to.be.undefined;
} else {
expect(created).to.be.okay;
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm, okay is supported too :D

@sushantdhiman sushantdhiman requested a review from a team February 27, 2018 06:10
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.

3 participants