2014-12-20 14:26:46 +08:00
|
|
|
import Ember from 'ember';
|
|
|
|
import DS from 'ember-data';
|
|
|
|
|
|
|
|
export default DS.Model.extend({
|
2015-02-10 15:35:40 +08:00
|
|
|
discussion: DS.belongsTo('discussion', {inverse: 'loadedPosts'}),
|
|
|
|
number: DS.attr('number'),
|
2014-12-20 14:26:46 +08:00
|
|
|
|
2015-02-10 15:35:40 +08:00
|
|
|
time: DS.attr('date'),
|
|
|
|
user: DS.belongsTo('user'),
|
|
|
|
type: DS.attr('string'),
|
|
|
|
content: DS.attr('string'),
|
|
|
|
contentHtml: DS.attr('string'),
|
2014-12-20 14:26:46 +08:00
|
|
|
|
2015-02-10 15:35:40 +08:00
|
|
|
editTime: DS.attr('date'),
|
|
|
|
editUser: DS.belongsTo('user'),
|
|
|
|
isEdited: Ember.computed.notEmpty('editTime'),
|
2014-12-20 14:26:46 +08:00
|
|
|
|
2015-02-12 12:05:24 +08:00
|
|
|
hideTime: DS.attr('date'),
|
|
|
|
hideUser: DS.belongsTo('user'),
|
2015-02-10 15:35:40 +08:00
|
|
|
isHidden: DS.attr('boolean'),
|
2014-12-20 14:26:46 +08:00
|
|
|
|
2015-02-10 15:35:40 +08:00
|
|
|
canEdit: DS.attr('boolean'),
|
|
|
|
canDelete: DS.attr('boolean')
|
2014-12-20 14:26:46 +08:00
|
|
|
});
|