This code is wrong. Should be like that:
```
var sql = 'SELECT '
if (filter.attributes) {
    sql += this.formatAttributesList(model, filter.attributes);
} else {
    sql += '*';
}