model.destroy option required has wrong default
See original GitHub issueI’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:
- Created 6 years ago
- Comments:8 (7 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Playrom We can keep this in mind for maybe a 1.0 release, in the meantime we can update docs.
Fixed with #1779.