Use this.site.categories

This commit is contained in:
Kane York 2015-07-15 16:16:07 -07:00
parent 090f3cbc64
commit d79f667a9b
1 changed files with 1 additions and 2 deletions

View File

@ -83,13 +83,12 @@ export default Ember.Component.extend({
case 'post_id':
return isPositiveInt || /\d+\/\d+(\?u=.*)?$/.test(value);
case 'category_id':
const cats = Category.list();
if (!isPositiveInt && value !== value.dasherize()) {
this.set('value', value.dasherize());
}
if (isPositiveInt) {
return !!cats.find(function(c) {
return !!this.site.categories.find(function(c) {
return c.get('id') === intVal;
});
} else if (/\//.test(value)) {