findByAssociation has problems with auto generated coloumn by `.hasOne` method with `mapsTo` option.
Opened this issue · 0 comments
reumia commented
// Defining Model
LikesCut.hasOne('target', Cuts, {reverse: 'likes', field: 'targetId', mapsTo: 'target_id', required: true})
// CASE 1 : ER_BAD_FIELD_ERROR: Unknown column 't1.targetId' in 'on clause'
LikesCut.findByTarget({}).runAsync()
// CASE 2 : ER_BAD_FIELD_ERROR: Unknown column 't2.targetId' in 'on clause'
Cuts.findByLikes({}).runAsync()
it seems to tying join
with wrong column name.
is there something wrong in my codes or isn't it prepared yet?