framework/ember/app/models/post.js

25 lines
611 B
JavaScript
Raw Normal View History

2014-12-20 14:26:46 +08:00
import Ember from 'ember';
import DS from 'ember-data';
export default DS.Model.extend({
discussion: DS.belongsTo('discussion', {inverse: 'loadedPosts'}),
number: DS.attr('number'),
2014-12-20 14:26:46 +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
editTime: DS.attr('date'),
editUser: DS.belongsTo('user'),
isEdited: Ember.computed.notEmpty('editTime'),
2014-12-20 14:26:46 +08:00
hideTime: DS.attr('date'),
hideUser: DS.belongsTo('user'),
isHidden: DS.attr('boolean'),
2014-12-20 14:26:46 +08:00
canEdit: DS.attr('boolean'),
canDelete: DS.attr('boolean')
2014-12-20 14:26:46 +08:00
});