From: Seth Woodworth Date: Sun, 22 Jan 2012 21:45:11 +0000 (-0500) Subject: modify schools to have a 'slug' name value X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b231ed8f6d31ae5d145051b7c8500eb7713f5406;p=oweals%2Ffinalsclub.git modify schools to have a 'slug' name value --- diff --git a/models.js b/models.js index bf83af7..a379ed8 100644 --- a/models.js +++ b/models.js @@ -138,18 +138,22 @@ var SchoolSchema = new Schema( { description : String, url : String, - created : { type : Date, default : Date.now }, - hostnames : Array, + created : { type : Date, default : Date.now }, + hostnames : Array, - users : Array + users : Array, + + slug : String }); +// slug is the url version of a school SchoolSchema.virtual( 'sanitized' ).get(function() { var school = { _id: this._id, name: this.name, description: this.description, - url: this.url + url: this.url, + slug: this.slug } return school;