mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 19:33:02 +03:00
8d9d9de8d4
refs https://github.com/TryGhost/Team/issues/3169 - Added a lits to a collection view showing which posts belong to a collection.
34 lines
940 B
JavaScript
34 lines
940 B
JavaScript
import Model from '@ember-data/model';
|
|
import ValidationEngine from 'ghost-admin/mixins/validation-engine';
|
|
import {attr} from '@ember-data/model';
|
|
import {computed} from '@ember/object';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
export default Model.extend(ValidationEngine, {
|
|
validationType: 'collection',
|
|
|
|
title: attr('string'),
|
|
slug: attr('string'),
|
|
description: attr('string'),
|
|
type: attr('string', {defaultValue: 'manual'}),
|
|
filter: attr('string'),
|
|
featureImage: attr('string'),
|
|
createdAtUTC: attr('moment-utc'),
|
|
updatedAtUTC: attr('moment-utc'),
|
|
createdBy: attr('number'),
|
|
updatedBy: attr('number'),
|
|
count: attr('raw'),
|
|
|
|
posts: attr('raw'),
|
|
|
|
postIds: computed('posts', function () {
|
|
if (this.posts && this.posts.length) {
|
|
return this.posts.map(post => post.id);
|
|
} else {
|
|
return [];
|
|
}
|
|
}),
|
|
|
|
feature: service()
|
|
});
|