}
},
lastName: DataTypes.STRING,
- tags: DataTypes.STRING,
+ tags: {
+ type: DataTypes.STRING,
+ get: function() {
+ var tags;
+ if (this.getDataValue('tags')) {
+ tags = this.getDataValue('tags').split(';');
+ if (tags.length > 1) {
+ tags.pop();
+ } else {
+ tags = []; //if the length is 1 the value is still in the format of the old tags, with comma separator. So I return an empty array since the old format is obsolete and invalid
+ }
+ } else {
+ tags = [];
+ }
+ return tags;
+ },
+ set: function(val) {
+ this.setDataValue('tags', val && val.length ? val.join(';') + ';' : null);
+ }
+ },
street: DataTypes.STRING,
postalCode: DataTypes.STRING,
city: DataTypes.STRING,
country: DataTypes.STRING,
dateOfBirth: DataTypes.STRING,
- description: DataTypes.STRING,
+ description: DataTypes.TEXT,
phone: DataTypes.STRING,
mobile: DataTypes.STRING,
fax: DataTypes.STRING,
email: DataTypes.STRING,
- url: DataTypes.STRING
+ url: DataTypes.STRING,
+ planningtime: DataTypes.DATE
}, {
tableName: 'cm_contacts',
associate: function(models) {
};
if (query.CompanyId) {
scope.where.CompanyId = query.CompanyId;
- delete query.CompanyId;
}
if (query.ListId) {
scope.where.ListId = query.ListId;
- delete query.ListId;
}
return scope;
});