mirror of
https://github.com/flarum/framework.git
synced 2024-12-12 14:13:37 +08:00
a62e04f956
Note: npm source for ember-json-api changed to a fork, but I still had to apply a custom change to get polymorphic relationships to work (see https://github.com/kurko/ember-json-api/pull/71#issuecomment-85257281)
25 lines
610 B
JavaScript
25 lines
610 B
JavaScript
import Ember from 'ember';
|
|
import DS from 'ember-data';
|
|
|
|
export default DS.Model.extend({
|
|
discussion: DS.belongsTo('discussion', {inverse: 'loadedPosts'}),
|
|
number: DS.attr('number'),
|
|
|
|
time: DS.attr('date'),
|
|
user: DS.belongsTo('user'),
|
|
contentType: DS.attr('string'),
|
|
content: DS.attr(),
|
|
contentHtml: DS.attr('string'),
|
|
|
|
editTime: DS.attr('date'),
|
|
editUser: DS.belongsTo('user'),
|
|
isEdited: Ember.computed.notEmpty('editTime'),
|
|
|
|
hideTime: DS.attr('date'),
|
|
hideUser: DS.belongsTo('user'),
|
|
isHidden: DS.attr('boolean'),
|
|
|
|
canEdit: DS.attr('boolean'),
|
|
canDelete: DS.attr('boolean')
|
|
});
|