Skip to content

Instantly share code, notes, and snippets.

@guidouil
Created April 15, 2015 11:31
Show Gist options
  • Save guidouil/9ccbf598fb0eef8c6d3e to your computer and use it in GitHub Desktop.
Save guidouil/9ccbf598fb0eef8c6d3e to your computer and use it in GitHub Desktop.
Cover page (intro) schema
Schemas.CoverPages = new SimpleSchema({
title: {
type: String,
label: 'Presentation title'
},
date: {
type: Date,
optional: true,
label: "Date"
},
logo: {
type: String,
optional: true,
label: "Logo"
},
clientLogo: {
type: String,
optional: true,
label: "Client logo"
},
background: {
type: String,
optional: true,
label: "Background picture"
},
createdAt: {
type: Date,
autoValue: function() {
if (this.isInsert) {
return new Date();
} else if (this.isUpsert) {
return {$setOnInsert: new Date()};
} else {
this.unset();
}
}
},
updatedAt: {
type: Date,
autoValue: function() {
if (this.isUpdate) {
return new Date();
}
},
denyInsert: true,
optional: true
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment