discourse/app/assets/javascripts/discourse/models/user-action-stat.js.es6
2015-08-10 10:21:05 -04:00

22 lines
681 B
JavaScript

import RestModel from 'discourse/models/rest';
import UserAction from 'discourse/models/user-action';
import { i18n } from 'discourse/lib/computed';
export default RestModel.extend({
isPM: function() {
const actionType = this.get('action_type');
return actionType === UserAction.TYPES.messages_sent ||
actionType === UserAction.TYPES.messages_received;
}.property('action_type'),
description: i18n('action_type', 'user_action_groups.%@'),
isResponse: function() {
const actionType = this.get('action_type');
return actionType === UserAction.TYPES.replies ||
actionType === UserAction.TYPES.quotes;
}.property('action_type')
});