When I try to associate two models after set the hasOne relation
let District = this.models['district'];
let City = this.models['city'];
District.hasOne('city', City, { reverse: true });
I get this error:
TypeError: district.setOwner is not a function
at E:\Node\http-request\testadb.js:44:72
at E:\Node\http-request\node_modules\orm\lib\Model.js:616:4
at E:\Node\http-request\node_modules\async\dist\async.js:356:16
at replenish (E:\Node\http-request\node_modules\async\dist\async.js:877:25)
at iterateeCallback (E:\Node\http-request\node_modules\async\dist\async.js:867:17)
at E:\Node\http-request\node_modules\async\dist\async.js:840:16
at E:\Node\http-request\node_modules\orm\lib\Model.js:609:6
at E:\Node\http-request\node_modules\orm\lib\Instance.js:619:12
at saveInstanceExtra (E:\Node\http-request\node_modules\orm\lib\Instance.js:341:19)
at E:\Node\http-request\node_modules\orm\lib\Instance.js:190:5
When I try to associate two models after set the hasOne relation
let District = this.models['district']; let City = this.models['city']; District.hasOne('city', City, { reverse: true });
I get this error: