Load relationships on inserted ressource
I was wondering if there was a way to load relationships by default on an inserted ressource after a successful submit of a
for_create
form?
The goal here is to simply append that newly inserted ressource to a list afterwards, but I need some relationships to be loaded on that ressource. I know I can do it manually, but I was wondering if there was a way to define some defaults "load" somewhere?
Thanks a lot in advance 🙂5 Replies
you can do it on the resource preparations block, not 100% sure if that runs after a create
Yes, I should have mentioned that I did try that but it didn't work unfortunately. I assume that this is because there isn't an actual read query being done
how about custom change set on after_action which loads it?
There is a builtin change
change load(:foo)
I did not see that one, but it works perfectly! Thanks! 😄