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

Commit f5f3f133 by Daniel Durante

Cleaned up DAO Factory.

1 parent 50eca9cc
Showing with 2 additions and 4 deletions
...@@ -250,8 +250,8 @@ module.exports = (function() { ...@@ -250,8 +250,8 @@ module.exports = (function() {
} }
var primaryKeys = this.primaryKeys var primaryKeys = this.primaryKeys
, keys = Object.keys(primaryKeys) , keys = Object.keys(primaryKeys)
, keysLength = keys.length , keysLength = keys.length
// options is not a hash but an id // options is not a hash but an id
if (typeof options === 'number') { if (typeof options === 'number') {
...@@ -264,7 +264,6 @@ module.exports = (function() { ...@@ -264,7 +264,6 @@ module.exports = (function() {
} }
} else if (Utils._.size(primaryKeys) && Utils.argsArePrimaryKeys(arguments, primaryKeys)) { } else if (Utils._.size(primaryKeys) && Utils.argsArePrimaryKeys(arguments, primaryKeys)) {
var where = {} var where = {}
, self = this
Utils._.each(arguments, function(arg, i) { Utils._.each(arguments, function(arg, i) {
var key = keys[i] var key = keys[i]
...@@ -295,7 +294,6 @@ module.exports = (function() { ...@@ -295,7 +294,6 @@ module.exports = (function() {
this.options.whereCollection = options.where || null this.options.whereCollection = options.where || null
} else if (typeof options === "string") { } else if (typeof options === "string") {
var where = {} var where = {}
, keys = Object.keys(primaryKeys)
if (this.primaryKeyCount === 1) { if (this.primaryKeyCount === 1) {
where[primaryKeys[keys[0]]] = options; where[primaryKeys[keys[0]]] = options;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!