fix typo; import format
This commit is contained in:
parent
bd1c221e36
commit
809af8063f
@ -15,9 +15,9 @@ import {Rehydratable} from '../../../lib/src/support/Rehydratable.ts'
|
|||||||
import {HasOne} from './relation/HasOne.ts'
|
import {HasOne} from './relation/HasOne.ts'
|
||||||
import Instantiable from '../../../di/src/type/Instantiable.ts'
|
import Instantiable from '../../../di/src/type/Instantiable.ts'
|
||||||
import {HasMany} from './relation/HasMany.ts'
|
import {HasMany} from './relation/HasMany.ts'
|
||||||
import {ModelSelect} from "./query/ModelSelect.ts";
|
import {ModelSelect} from './query/ModelSelect.ts'
|
||||||
import {Relation} from "./relation/Relation.ts";
|
import {Relation} from './relation/Relation.ts'
|
||||||
import {HasOneOrMany} from "./relation/HasOneOrMany.ts";
|
import {HasOneOrMany} from './relation/HasOneOrMany.ts'
|
||||||
|
|
||||||
// TODO separate read/write connections
|
// TODO separate read/write connections
|
||||||
// TODO manual dirty flags
|
// TODO manual dirty flags
|
||||||
@ -1006,7 +1006,7 @@ abstract class Model<T extends Model<T>> extends Builder<T> implements Rehydrata
|
|||||||
const relation = related_inst.get_relation(relation_name)
|
const relation = related_inst.get_relation(relation_name)
|
||||||
|
|
||||||
if ( !(relation instanceof HasOneOrMany) ) {
|
if ( !(relation instanceof HasOneOrMany) ) {
|
||||||
throw new TypeError(`Cannot create belongs to one relation. Inverse relation must be has one or many.`)
|
throw new TypeError(`Cannot create belongs to many relation. Inverse relation must be has one or many.`)
|
||||||
}
|
}
|
||||||
|
|
||||||
return new HasMany(this as any, related_inst, relation.local_key, relation.foreign_key)
|
return new HasMany(this as any, related_inst, relation.local_key, relation.foreign_key)
|
||||||
|
Loading…
Reference in New Issue
Block a user