},
lastEvent: {
type: DataTypes.ENUM('SENT', 'SENDING', 'RECEIVED', 'FAILED', 'NOTE')
- }
+ },
+ tags: {
+ type: DataTypes.TEXT,
+ get: function() {
+ var tags;
+ if (this.getDataValue('tags')) {
+ tags = this.getDataValue('tags').split(';');
+ tags.pop();
+ } else {
+ tags = [];
+ }
+ return tags;
+ },
+ set: function(val) {
+ this.setDataValue('tags', val && val.length ? val.join(';') + ';' : null);
+ }
+ },
}, {
tableName: 'fax_rooms',
paranoid: true,
}, {
model: models.FaxMessage,
include: [{
+ model: models.FaxAttachment
+ }, {
model: models.User,
attributes: ['id', 'name', 'fullname', 'email']
}]