I was unsure whether this should go in lucid or here, so please forgive me if I got it wrong.
I have a belongsToMany that has an intersect table.
It associates a User as an admin of an Organisation through an intersect table "organisation_admins"
That intersect table has softdeletes enabled, but the relationship returns all results regardless of whether they have been deleted
return this.belongsToMany('App/Model/Organisation','organisation_admins','user_id','organisation_id')
It is easily fixed with the following, but I feel like this should be implicit in the behaviour of belongsToMany?
return this.belongsToMany('App/Model/Organisation','organisation_admins','user_id','organisation_id').where('deleted_at',null)
Should be good with 4.0
Closing since no answer from issue reporter.
HI @thetutlage - you said that this should be good to go with 4.0, but i don't see soft deletes in the docs for 4.0. Has it been removed?
Hi, are there news about soft deletes?
@dusbuss could you find anything?
@shinobiwarrior - haven't found anything about it yet
Still waiting for it, there鈥檚 an open issue on the Adonis lucid repo that has been assigned so any updates will be there
Thanks to both of you, I'll subscribe to that issue
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
HI @thetutlage - you said that this should be good to go with 4.0, but i don't see soft deletes in the docs for 4.0. Has it been removed?