Made Achievements and Campaigns patchable.

This commit is contained in:
Scott Erickson 2015-02-05 12:01:19 -08:00
parent eafecaf492
commit f9ee100e73
5 changed files with 5 additions and 1 deletions

View file

@ -91,5 +91,6 @@ AchievementSchema.definitions = {}
AchievementSchema.definitions['mongoQueryOperator'] = MongoQueryOperatorSchema
AchievementSchema.definitions['mongoFindQuery'] = MongoFindQuerySchema
c.extendTranslationCoverageProperties AchievementSchema
c.extendPatchableProperties AchievementSchema
module.exports = AchievementSchema

View file

@ -124,5 +124,6 @@ _.extend CampaignSchema.properties, {
c.extendBasicProperties CampaignSchema, 'campaign'
c.extendTranslationCoverageProperties CampaignSchema
c.extendPatchableProperties CampaignSchema
module.exports = CampaignSchema

View file

@ -1,6 +1,6 @@
c = require './../schemas'
patchables = ['level', 'thang_type', 'level_system', 'level_component', 'article', 'achievement']
patchables = ['level', 'thang_type', 'level_system', 'level_component', 'article', 'achievement', 'campaign']
PatchSchema = c.object({title: 'Patch', required: ['target', 'delta', 'commitMessage']}, {
delta: {title: 'Delta', type: ['array', 'object']}

View file

@ -81,6 +81,7 @@ AchievementSchema.post 'save', -> @constructor.loadAchievements()
AchievementSchema.plugin(plugins.NamedPlugin)
AchievementSchema.plugin(plugins.SearchablePlugin, {searchable: ['name']})
AchievementSchema.plugin plugins.TranslationCoveragePlugin
AchievementSchema.plugin plugins.PatchablePlugin
module.exports = Achievement = mongoose.model('Achievement', AchievementSchema, 'achievements')

View file

@ -8,5 +8,6 @@ CampaignSchema.index({slug: 1}, {name: 'slug index', sparse: true, unique: true}
CampaignSchema.plugin(plugins.NamedPlugin)
CampaignSchema.plugin(plugins.TranslationCoveragePlugin)
CampaignSchema.plugin plugins.PatchablePlugin
module.exports = mongoose.model('campaign', CampaignSchema)