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

Commit 0d8dad41 by José Moreira

Paranoid on include

1 parent d0f998a0
Showing with 10 additions and 4 deletions
...@@ -1573,8 +1573,9 @@ module.exports = (function() { ...@@ -1573,8 +1573,9 @@ module.exports = (function() {
// private // private
var paranoidClause = function(options) { var paranoidClause = function ( options ) {
if (this.options.paranoid === true) { if ( ! this.options.paranoid ) return options || {};
options = options || {} options = options || {}
options.where = options.where || {} options.where = options.where || {}
...@@ -1603,9 +1604,14 @@ module.exports = (function() { ...@@ -1603,9 +1604,14 @@ module.exports = (function() {
} else { } else {
options.where[deletedAtCol] = null options.where[deletedAtCol] = null
} }
}
return options // Apply on each include
if ( options.include && options.include.length )
for( var i in options.include )
if( typeof options.include[i] == 'object' )
paranoidClause.call( options.include[i].daoFactory, options.include[i] );
return options;
} }
var addOptionalClassMethods = function() { var addOptionalClassMethods = function() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!