summaryrefslogtreecommitdiff
path: root/server/lib/schemas/Documentation.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2014-06-09 16:14:49 -0400
committerJules Laplace <jules@okfoc.us>2014-06-09 16:14:49 -0400
commit1165ef5440e643252635aeea73a14cba0bb2e461 (patch)
tree6563f5314c774ee3ac9216e8375b38037b2eddcb /server/lib/schemas/Documentation.js
parentb1974b9c2fe6ee1f35b3e34895f134d906299cec (diff)
documentation system
Diffstat (limited to 'server/lib/schemas/Documentation.js')
-rw-r--r--server/lib/schemas/Documentation.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/server/lib/schemas/Documentation.js b/server/lib/schemas/Documentation.js
new file mode 100644
index 0000000..35cf34f
--- /dev/null
+++ b/server/lib/schemas/Documentation.js
@@ -0,0 +1,33 @@
+/* jshint node: true */
+
+
+var mongoose = require('mongoose'),
+ _ = require('lodash'),
+ util = require('../util');
+
+var DocumentationSchema = new mongoose.Schema({
+ name: {
+ type: String,
+ required: true,
+ unique: true,
+ validate: [function (val){
+ val = util.slugify(val || this.displayName || "")
+ if (! val.length) return false
+ if (val == "new") return false
+ return true
+ },"{PATH} name is required"]
+ },
+ displayName: {
+ type: String,
+ },
+ body: {
+ type: String,
+ default: ""
+ },
+ created_at: { type: Date },
+ updated_at: { type: Date },
+});
+
+
+module.exports = exports = mongoose.model('documentation', DocumentationSchema);
+exports.schema = DocumentationSchema;