mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-28 23:13:59 -04:00
Made Achievements and Campaigns patchable.
This commit is contained in:
parent
eafecaf492
commit
f9ee100e73
5 changed files with 5 additions and 1 deletions
app/schemas/models
server
|
@ -91,5 +91,6 @@ AchievementSchema.definitions = {}
|
||||||
AchievementSchema.definitions['mongoQueryOperator'] = MongoQueryOperatorSchema
|
AchievementSchema.definitions['mongoQueryOperator'] = MongoQueryOperatorSchema
|
||||||
AchievementSchema.definitions['mongoFindQuery'] = MongoFindQuerySchema
|
AchievementSchema.definitions['mongoFindQuery'] = MongoFindQuerySchema
|
||||||
c.extendTranslationCoverageProperties AchievementSchema
|
c.extendTranslationCoverageProperties AchievementSchema
|
||||||
|
c.extendPatchableProperties AchievementSchema
|
||||||
|
|
||||||
module.exports = AchievementSchema
|
module.exports = AchievementSchema
|
||||||
|
|
|
@ -124,5 +124,6 @@ _.extend CampaignSchema.properties, {
|
||||||
|
|
||||||
c.extendBasicProperties CampaignSchema, 'campaign'
|
c.extendBasicProperties CampaignSchema, 'campaign'
|
||||||
c.extendTranslationCoverageProperties CampaignSchema
|
c.extendTranslationCoverageProperties CampaignSchema
|
||||||
|
c.extendPatchableProperties CampaignSchema
|
||||||
|
|
||||||
module.exports = CampaignSchema
|
module.exports = CampaignSchema
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
c = require './../schemas'
|
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']}, {
|
PatchSchema = c.object({title: 'Patch', required: ['target', 'delta', 'commitMessage']}, {
|
||||||
delta: {title: 'Delta', type: ['array', 'object']}
|
delta: {title: 'Delta', type: ['array', 'object']}
|
||||||
|
|
|
@ -81,6 +81,7 @@ AchievementSchema.post 'save', -> @constructor.loadAchievements()
|
||||||
AchievementSchema.plugin(plugins.NamedPlugin)
|
AchievementSchema.plugin(plugins.NamedPlugin)
|
||||||
AchievementSchema.plugin(plugins.SearchablePlugin, {searchable: ['name']})
|
AchievementSchema.plugin(plugins.SearchablePlugin, {searchable: ['name']})
|
||||||
AchievementSchema.plugin plugins.TranslationCoveragePlugin
|
AchievementSchema.plugin plugins.TranslationCoveragePlugin
|
||||||
|
AchievementSchema.plugin plugins.PatchablePlugin
|
||||||
|
|
||||||
module.exports = Achievement = mongoose.model('Achievement', AchievementSchema, 'achievements')
|
module.exports = Achievement = mongoose.model('Achievement', AchievementSchema, 'achievements')
|
||||||
|
|
||||||
|
|
|
@ -8,5 +8,6 @@ CampaignSchema.index({slug: 1}, {name: 'slug index', sparse: true, unique: true}
|
||||||
|
|
||||||
CampaignSchema.plugin(plugins.NamedPlugin)
|
CampaignSchema.plugin(plugins.NamedPlugin)
|
||||||
CampaignSchema.plugin(plugins.TranslationCoveragePlugin)
|
CampaignSchema.plugin(plugins.TranslationCoveragePlugin)
|
||||||
|
CampaignSchema.plugin plugins.PatchablePlugin
|
||||||
|
|
||||||
module.exports = mongoose.model('campaign', CampaignSchema)
|
module.exports = mongoose.model('campaign', CampaignSchema)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue