Skip to content

Commit

Permalink
remove duplicate declaration of async accessors methods
Browse files Browse the repository at this point in the history
  • Loading branch information
mradko committed Sep 27, 2017
1 parent 180a389 commit c79692b
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/Associations/Many.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ exports.prepare = function (db, Model, associations) {
}) ||
util.formatField(OtherModel, name, true, opts.reversed),
{ makeKey: makeKey, required: true }
)
);

var assocName = opts.name || ucfirst(name);
var assocTemplateName = opts.accessor || assocName;
Expand All @@ -85,12 +85,6 @@ exports.prepare = function (db, Model, associations) {
hasAccessor : opts.hasAccessor || ("has" + assocTemplateName),
delAccessor : opts.delAccessor || ("remove" + assocTemplateName),
addAccessor : opts.addAccessor || ("add" + assocTemplateName),

getAccessorAsync : opts.getAccessor + promiseFunctionPostfix || ("get" + assocTemplateName + promiseFunctionPostfix),
setAccessorAsync : opts.setAccessor + promiseFunctionPostfix || ("set" + assocTemplateName + promiseFunctionPostfix),
hasAccessorAsync : opts.hasAccessor + promiseFunctionPostfix || ("has" + assocTemplateName + promiseFunctionPostfix),
delAccessorAsync : opts.delAccessor + promiseFunctionPostfix || ("remove" + assocTemplateName + promiseFunctionPostfix),
addAccessorAsync : opts.addAccessor + promiseFunctionPostfix || ("add" + assocTemplateName + promiseFunctionPostfix)
};
associations.push(association);

Expand Down

0 comments on commit c79692b

Please sign in to comment.