mirror of
https://github.com/zhigang1992/deployd.git
synced 2026-05-24 05:47:45 +08:00
28 lines
591 B
JavaScript
28 lines
591 B
JavaScript
var Model = require('../../model')
|
|
, models = require('../models')
|
|
;
|
|
|
|
module.exports = Model.spawn({
|
|
|
|
collection: 'settings',
|
|
plugin: 'settings',
|
|
|
|
description: {
|
|
name: {type: 'string', unique: true, required: true},
|
|
plugin: 'string',
|
|
collection: 'string',
|
|
description: 'object'
|
|
},
|
|
|
|
refresh: function(changes) {
|
|
if(!changes.errors) {
|
|
if(changes.plugin === 'models') models.refresh();
|
|
else if(changes.collection) Model.refreshSettings(changes.collection);
|
|
}
|
|
|
|
Model.refresh.apply(this, arguments);
|
|
},
|
|
|
|
strict: false
|
|
|
|
}); |