Skip to content

Documentation


Documentation / @blazetrails/activerecord / Associations

Class: Associations ​

Defined in: packages/activerecord/lib/associations.ts:93

Constructors ​

Constructor ​

new Associations(): Associations

Returns ​

Associations

Methods ​

belongsTo() ​

static belongsTo(this, name, scope?, options?): void

Defined in: packages/activerecord/lib/associations.ts:94

Parameters ​

ParameterTypeDefault value
thistypeof Baseundefined
namestringundefined
scope((this, ...args) => any) | AssociationOptions | nullnull
optionsAssociationOptions{}

Returns ​

void


hasAndBelongsToMany() ​

static hasAndBelongsToMany(this, name, scope?, options?, extension?): void

Defined in: packages/activerecord/lib/associations.ts:148

Parameters ​

ParameterTypeDefault value
thistypeof Baseundefined
namestringundefined
scope((this, ...args) => any) | AssociationOptions & { joinTable?: string; } | nullnull
optionsAssociationOptions & { joinTable?: string; }{}
extension?(mod) => voidundefined

Returns ​

void


hasMany() ​

static hasMany(this, name, scope?, options?, extension?): void

Defined in: packages/activerecord/lib/associations.ts:127

Parameters ​

ParameterTypeDefault value
thistypeof Baseundefined
namestringundefined
scopeAssociationOptions | ((this, ...args) => any) | nullnull
optionsAssociationOptions{}
extension?(mod) => voidundefined

Returns ​

void


hasOne() ​

static hasOne(this, name, scope?, options?): void

Defined in: packages/activerecord/lib/associations.ts:113

Parameters ​

ParameterTypeDefault value
thistypeof Baseundefined
namestringundefined
scopeAssociationOptions | ((this, ...args) => any) | nullnull
optionsAssociationOptions{}

Returns ​

void