mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-13 22:41:32 -05:00
18 lines
393 B
JavaScript
18 lines
393 B
JavaScript
|
var PostValidator = Ember.Object.create({
|
||
|
validate: function (model) {
|
||
|
var validationErrors = [],
|
||
|
|
||
|
title = model.get('title');
|
||
|
|
||
|
if (validator.empty(title)) {
|
||
|
validationErrors.push({
|
||
|
message: 'You must specify a title for the post.'
|
||
|
});
|
||
|
}
|
||
|
|
||
|
return validationErrors;
|
||
|
}
|
||
|
});
|
||
|
|
||
|
export default PostValidator;
|