I'm trying to fetch a model with a relation (via join). This related Model contains a json field I set in jsonAttributes. If I query the related Model itself, this field get's returned as Object. If I query it via joinRelated, I just get it as a string. PMAC or bug?
Message.js
class Message extends Model {
static get tableName () {
return 'messages';
}
static get relationMappings () {
return {
alias: {
relation: Model.BelongsToOneRelation,
modelClass: Alias,
join: {
from: 'messages.alias_id',
to: 'capcodes.id'
}
}
}
}
...
}
Alias.js
class Alias extends Model {
static get tableName () {
return 'capcodes';
}
static get jsonAttributes () {
return ['pluginconf'];
}
static get relationMappings () {
const { Message } = require('./Message');
return {
messages: {
relation: Model.HasManyRelation,
modelClass: Message,
join: {
from: 'capcodes.id',
to: 'messages.alias_id'
}
}
}
}
...
}
Hello,
I'm trying to fetch a model with a relation (via join). This related Model contains a json field I set in jsonAttributes. If I query the related Model itself, this field get's returned as Object. If I query it via joinRelated, I just get it as a string. PMAC or bug?
Message.js
Alias.js
Real return
Expected result:
Result of a direct query to Alias: