Permalink
Browse files

added possibility to define the relevant attribute of getDAO

  • Loading branch information...
sdepold committed Oct 2, 2012
1 parent d863a5f commit 5c567796a0bb0a9134ca9607e6e240375d335e4b
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/dao-factory-manager.js
@@ -16,9 +16,12 @@ module.exports = (function() {
})
}
- DAOFactoryManager.prototype.getDAO = function(daoName) {
+ DAOFactoryManager.prototype.getDAO = function(daoName, options) {
+ options = options || {}
+ options.attribute = options.attribute || 'name'
+
var dao = this.daos.filter(function(dao) {
- return dao.name == daoName
+ return dao[options.attribute] === daoName
})
return !!dao ? dao[0] : null

0 comments on commit 5c56779

Please sign in to comment.