modify schools to have a 'slug' name value
authorSeth Woodworth <seth@sethish.com>
Sun, 22 Jan 2012 21:45:11 +0000 (16:45 -0500)
committerSeth Woodworth <seth@sethish.com>
Sun, 22 Jan 2012 21:45:11 +0000 (16:45 -0500)
models.js

index bf83af792a49fdfb2deb3823378fb66088007ab5..a379ed86b972a45da9f1a91bec58ab19bd44e7af 100644 (file)
--- 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;