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

Commit bdd6251b by Daniel Durante

Merge pull request #1074 from elliotf/findOrCreate_does_not_modify_inputs

Do not modify input to findOrCreate
2 parents ad2661d0 e3db6535
Showing with 6 additions and 1 deletions
...@@ -592,9 +592,14 @@ module.exports = (function() { ...@@ -592,9 +592,14 @@ module.exports = (function() {
}).run() }).run()
} }
DAOFactory.prototype.findOrCreate = function (params, defaults) { DAOFactory.prototype.findOrCreate = function (where, defaults) {
var self = this; var self = this;
var params = {};
for (var attrname in where) {
params[attrname] = where[attrname]
}
return new Utils.CustomEventEmitter(function (emitter) { return new Utils.CustomEventEmitter(function (emitter) {
self.find({ self.find({
where: params where: params
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!