-
-
Notifications
You must be signed in to change notification settings - Fork 43
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Environment
No response
Reproduction
related to #1818
Describe the bug
I'm using a custom cast with one of my model fields and that cast provides a getter and a setter.
I just noticed that when I load related models, the getter is not being executed. It is executed fine when I query the model directly but not if I load a parent model.
So here it works well
const requirements = useRepo(Requirement).all()
console.log(requirements); // here the cast is applied and the getter is used
but here it doesn't
const architectureView = useRepo(ArchitectureView) //
.with('requirements')
.where('id', this.currentArchitectureView.id)
.first();
console.log(architectureView.requirements); // here the cast is not applied and the getter is not used
I believe this is a bug right? If it's intended.. is there a way to circumvent that so the getter is always used?
Thanks!
Additional context
No response
Logs
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working