question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

model.destroy option required has wrong default

See original GitHub issue

I’m using model.destroy in a record that doesn’t exist and I’m not getting the Model.NoRowsDeletedError error.

I need to set explicitly the options.required to true to get the error.

I’m quite sure this is not the intended behavior because the documentations also states the default is true and because model.save doesn’t work that way.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
ebramanticommented, Jul 23, 2017

@Playrom We can keep this in mind for maybe a 1.0 release, in the meantime we can update docs.

0reactions
ricardogracacommented, Mar 4, 2018

Fixed with #1779.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Model#destroy documentation seems to be incorrect #1053
The documentation for Model#destroy says that the require option is true by default. But this code snippet seems to show that this is...
Read more >
In Sequelize model.destroy({ truncate: true }) does not reset ...
In Sequelize, I am using this function model.destory({ truncate: true }), it delete all data in table. But the issue is that it...
Read more >
JavaScript - Bootstrap
DEFAULTS.keyboard = false // changes default for the modal plugin's ... Sometimes it is necessary to use Bootstrap plugins with other UI frameworks....
Read more >
has_many (ActiveRecord::Associations::ClassMethods)
If the :through option is true callbacks in the join models are triggered except destroy callbacks, since deletion is direct by default.
Read more >
Model Querying - Basics - Sequelize
Sequelize provides various methods to assist querying your database for data.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found