Changed how levels are handled

This commit is contained in:
Thaum
2015-03-02 19:38:53 +00:00
parent 80d44ff310
commit 88dbaccfc5
14 changed files with 110 additions and 66 deletions

View File

@@ -0,0 +1,22 @@
Classes = new Meteor.Collection("classes");
Schemas.Class = new SimpleSchema({
charId: {type: String, regEx: SimpleSchema.RegEx.Id},
name: {type: String, trim: false},
level: {type: Number},
createdAt: {
type: Date,
autoValue: function() {
if (this.isInsert) {
return new Date;
} else if (this.isUpsert) {
return {$setOnInsert: new Date};
} else {
this.unset();
}
}
},
color: {type: String, allowedValues: _.pluck(colorOptions, "key"), defaultValue: "q"}
});
Classes.attachSchema(Schemas.Class);