bnoguchi/mongoose-auth — Issue #54: populate everyauth.user
Author: rskuja
Created: 2011-11-11 10:24:53+00:00
State: open

Im using expres and i have defined extra param for user
houses: [{ type: Schema.ObjectId, ref: 'Property', required: false}]
now i would need to populate this by calling .populate('houses') and i need to do it for every page to my active user, so i could call everyauth.user.house[i].name for example in my views. So my question - where should correctly put this populate? If it wouldnt be needed in every page i would put it in my controller, but since its needed everywhere i would like to extend everyauth express helper.