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

Commit e620b7d7 by Mick Hansen

refactor(model/find): fix issues and remove poor test

1 parent 484bc574
Showing with 3 additions and 23 deletions
...@@ -738,7 +738,7 @@ module.exports = (function() { ...@@ -738,7 +738,7 @@ module.exports = (function() {
} }
var options = {}; var options = {};
if (typeof param === 'number' || typeof param === 'string') { if (typeof param === 'number' || typeof param === 'string' || Buffer.isBuffer(param)) {
options.where = {}; options.where = {};
options.where[this.primaryKeyAttribute] = param; options.where[this.primaryKeyAttribute] = param;
} else { } else {
...@@ -1904,7 +1904,8 @@ module.exports = (function() { ...@@ -1904,7 +1904,8 @@ module.exports = (function() {
( (
elem._isSequelizeMethod || elem._isSequelizeMethod ||
elem instanceof Model || elem instanceof Model ||
elem instanceof Transaction elem instanceof Transaction ||
elem instanceof Association
) )
) { ) {
return elem; return elem;
......
...@@ -58,27 +58,6 @@ describe(Support.getTestDialectTeaser("Paranoid"), function () { ...@@ -58,27 +58,6 @@ describe(Support.getTestDialectTeaser("Paranoid"), function () {
}) })
it( 'test if default required behavior is marked as false', function ( done ) {
var A = this.A,
B = this.B,
options = {
include: [
{
model: B,
}
],
}
A.find( options ).done(function ( err ) {
expect( err ).not.to.be.ok
expect( options.include[0].required ).to.be.equal( false )
done()
})
})
it( 'test if non required is marked as false', function ( done ) { it( 'test if non required is marked as false', function ( done ) {
var A = this.A, 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!