Hi folks,
I'm trying to do something like the following in a table definition:
old_thumbnail: {
type: DataTypes.STRING(100),
filters: [],
get: function() {
var value = this.getDataValue('old_thumbnail');
return (value) ? config.assetUrl + value : null;
}
},
This works when accessed as-is. The problem is the data model in the API has changed such that the field needs to be output with a new name. I normally do that like this:
attributes: [..., ['old_thumbnail', 'thumbnail'], ...]
The problem is, when you do this the field getter doesn't "fire" and the raw value is returned instead of the processed one. Short of actually renaming the field in the database, is there a way to get this to work for both use-cases at the same time?