Permalink
Browse files

Update lib/associations/many.js

Added the ability to pass an association collection name to the options in the form:
{ autoFetch:true, association: '[collection_name]' }
  • Loading branch information...
1 parent a29c998 commit 67aa969aacc157926d578dffbc5ef20e14f173ef @Gamaroff Gamaroff committed Sep 20, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/associations/many.js
@@ -43,6 +43,7 @@ module.exports = {
create: function (instance, association, field, associationModel, associationOpts) {
var camelCaseAssociation = association.substr(0, 1).toUpperCase() + association.substr(1);
var collection = model + "_" + association;
+ var collection = associationOpts.association ? associationOpts.association : model + "_" + association;
instance.prototype["add" + camelCaseAssociation] = function () {
var instances = [], cb = null;

0 comments on commit 67aa969

Please sign in to comment.