From b231ed8f6d31ae5d145051b7c8500eb7713f5406 Mon Sep 17 00:00:00 2001 From: Seth Woodworth Date: Sun, 22 Jan 2012 16:45:11 -0500 Subject: [PATCH] modify schools to have a 'slug' name value --- models.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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; -- 2.25.1