[v5] realations with restrictions? possible? #1526
Answered
by
thetutlage
rbartholomay
asked this question in
Help
-
Hi! is it possible to define relations with restrictions in v5 inside the model? @belongsTo(() => CollectorIdrCatalog, {
localKey: 'item_id',
foreignKey: 'parent_item_id',
// where objectType = 6 ???
})
public contactcenter: BelongsTo<typeof CollectorIdrCatalog> Is this possible? Bye René |
Beta Was this translation helpful? Give feedback.
Answered by
thetutlage
Aug 28, 2020
Replies: 1 comment 1 reply
-
Covered in docs already https://preview.adonisjs.com/guides/model-relations/introduction/#on-query-hook |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
rbartholomay
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Covered in docs already https://preview.adonisjs.com/guides/model-relations/introduction/#on-query-hook