Skip to content

fix(model/update): propagate paranoid to individualHooks query - #10369

Merged
sushantdhiman merged 1 commit into
sequelize:masterfrom
miroslavLalev:fix-update
Jan 23, 2019
Merged

fix(model/update): propagate paranoid to individualHooks query#10369
sushantdhiman merged 1 commit into
sequelize:masterfrom
miroslavLalev:fix-update

Conversation

@miroslavLalev

@miroslavLalev miroslavLalev commented Jan 21, 2019

Copy link
Copy Markdown
Contributor
  • 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

I was testing some scenarios and noticed that when:

  1. Have a model with paranoid: true set
  2. Have beforeUpdate hook defined in the model
  3. Use the static <Model>.update method with individualHooks: true

The hook does not get called and therefore update statement is not executed. After a bit of investigation, I found the root cause - the paranoid option was not propagated to the select statement.

As it was quite straightforward change, I decided to give it a go and created PR directly :)

@miroslavLalev

Copy link
Copy Markdown
Contributor Author

It seems that the AppVeyor CI test failed with something sporadic as I couldn't reproduce it. Is there any way of retriggering it?

@codecov

codecov Bot commented Jan 23, 2019

Copy link
Copy Markdown

Codecov Report

Merging #10369 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #10369   +/-   ##
=======================================
  Coverage    96.3%    96.3%           
=======================================
  Files          92       92           
  Lines        9813     9813           
=======================================
  Hits         9450     9450           
  Misses        363      363
Impacted Files Coverage Δ
lib/model.js 96.77% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6c9b993...4254848. Read the comment docs.

@sushantdhiman
sushantdhiman merged commit 100b2dd into sequelize:master Jan 23, 2019
@sushantdhiman

Copy link
Copy Markdown
Contributor

Thanks @miroslavLalev

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