Skip to content

Commit

Permalink
Merge pull request #406 from yhanwen/patch-1
Browse files Browse the repository at this point in the history
fix: can't set custom model
  • Loading branch information
welefen committed Jul 29, 2016
2 parents d4191d3 + fd89894 commit 97da142
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/model/relation.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ export default class extends think.model.base {

switch(item.type){
case think.model.BELONG_TO:
if(item.model) {
delete item.model;
}
opts = think.extend(opts, {
key: opts.model.getModelName() + '_id',
fKey: 'id'
Expand Down Expand Up @@ -535,4 +538,4 @@ export default class extends think.model.base {
await Promise.all(promises);
return ids;
}
}
}

0 comments on commit 97da142

Please sign in to comment.