Ghost/ghost/admin/utils/validator-extensions.js
David Arvelo af47f88648 Add Validations Layer and Post Validations
closes #2893, issue #2850, issue #2856
- this is a stable, but quick and dirty validations layer for the time constraints
- this could be replaced with a unified server/client layer later. the infrastructure is there.
- create a validation engine mixin to match validators with models
- override the save method in the mixin to perform validations first
- create a post validator
- fixup calls to .save() to make sure they catch errors properly
2014-06-21 00:12:55 -04:00

16 lines
309 B
JavaScript

function init() {
// Provide a few custom validators
//
validator.extend('empty', function (str) {
return Ember.isBlank(str);
});
validator.extend('notContains', function (str, badString) {
return !_.contains(str, badString);
});
}
export default {
init: init
};