use assign in place of merge, make sure references to tavern and mods are not lost

This commit is contained in:
Matteo Pagliazzi
2015-08-14 22:02:19 +02:00
parent 2e1b046701
commit b31966b1ee
3 changed files with 6 additions and 4 deletions

View File

@@ -236,7 +236,8 @@ module.exports.tavern = {};
var tavernQ = {_id:'habitrpg','quest.key':{$ne:null}};
process.nextTick(function(){
mongoose.model('Group').findOne(tavernQ,function(err,tavern){
module.exports.tavern = tavern;
// Using _assign so we don't lose the reference to the exported tavern
_.assign(module.exports.tavern, tavern);
});
})
GroupSchema.statics.tavernBoss = function(user,progress) {