不要怂,就是干,撸起袖子干!

Commit 04b95b74 by Mick Hansen

Merge pull request #1859 from cusspvz/bugfix/paranoid

Bugfix/paranoid: paranoidClause problem without timestamps
2 parents 4cd0fc9c 2e173faf
Showing with 20 additions and 1 deletions
......@@ -1528,7 +1528,7 @@ module.exports = (function() {
// private
var paranoidClause = function(options ) {
if (! this.options.paranoid) return options || {};
if (! this.options.timestamps || ! this.options.paranoid) return options || {};
options = options || {};
options.where = options.where || {};
......
......@@ -39,6 +39,25 @@ describe(Support.getTestDialectTeaser("Paranoid"), function () {
})
it('paranoid with timestamps: false should be ignored / not crash', function (done) {
var S = this.sequelize,
Test = S.define('Test',{
name: DataTypes.STRING
},{
timestamps: false,
paranoid: true
});
S.sync({ force: true }).done(function () {
Test.find(1).done(function ( err ) {
expect( err ).to.be.not.ok
done()
})
})
})
it( 'test if default required behavior is marked as false', function ( done ) {
var A = this.A,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!