Open adamcikado opened 2 weeks ago
20.6.0
When using relationship sub query in whereIn() condition, the constraints are not being applied.
whereIn()
For example:
Post.query().whereIn('id', user.related('posts').query().select('id'))
The user_id = ID clause is not being added in this case.
user_id = ID
This issue occurs because applyConstraints() is not being called here https://github.com/adonisjs/lucid/blob/develop/src/database/query_builder/chainable.ts#L235.
applyConstraints()
I will create PR for this shortly.
No response
Package version
20.6.0
Describe the bug
When using relationship sub query in
whereIn()
condition, the constraints are not being applied.For example:
The
user_id = ID
clause is not being added in this case.This issue occurs because
applyConstraints()
is not being called here https://github.com/adonisjs/lucid/blob/develop/src/database/query_builder/chainable.ts#L235.I will create PR for this shortly.
Reproduction repo
No response