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

Commit 46211dcc by Rui Marinho

Fix assignment to read only property on `getDAO()`

Fixes support on node@0.11.15+ and io.js.
1 parent 8cea0fcf
Showing with 3 additions and 2 deletions
...@@ -25,8 +25,9 @@ module.exports = (function() { ...@@ -25,8 +25,9 @@ module.exports = (function() {
}; };
ModelManager.prototype.getDAO = function(daoName, options) { ModelManager.prototype.getDAO = function(daoName, options) {
options = options || {}; options = _.defaults(options || {}, {
options.attribute = options.attribute || 'name'; attribute: 'name'
});
var dao = this.daos.filter(function(dao) { var dao = this.daos.filter(function(dao) {
return dao[options.attribute] === daoName; return dao[options.attribute] === daoName;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!