Skip to content

Instantly share code, notes, and snippets.

@adamrneary
Created February 5, 2015 21:26
Show Gist options
  • Select an option

  • Save adamrneary/c75434e3d1219f9b7dbe to your computer and use it in GitHub Desktop.

Select an option

Save adamrneary/c75434e3d1219f9b7dbe to your computer and use it in GitHub Desktop.
UserSchema.methods.toJSON = function () {
var obj = this.toObject();
delete obj.password;
return obj;
};
UserSchema.methods.toCompleteJSON = function () {
var obj = this.toObject();
delete obj.password;
obj.isNewUser = this.isNewUser()
obj.isCompany = this.isCompany()
obj.isConsultant = this.isConsultant()
obj.isDummy = this.isDummy()
obj.isAdmin = this.isAdmin()
obj.isLinkedInAccount = this.isLinkedInAccount()
obj.positions = this.getPositions()
obj.educations = this.getEducations()
obj.summary = this.getSummary()
obj.industries = this.getIndustries()
obj.functionalAreas = this.getFunctionalAreas()
obj.profileScore = this.getProfileScore()
obj.hasValidProfileInfo = this.hasValidProfileInfo()
obj.aboutYouComplete = this.aboutYouComplete()
obj.businessSchool = this.getBusinessSchool()
obj.areTermsAccepted = this.areTermsAccepted()
obj.accountAge = this.accountAge()
obj.hoursPerWeekTier = this.hoursPerWeekTier()
obj.experienceLevelTier = this.experienceLevelTier()
obj.locationName = this.locationName()
obj.skills = this.getSkillsArray()
return obj;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment