How do I get `fragment` in scope in a `prepare` block?
I'm wanting to sort a query using a fragment. I found this https://elixirforum.com/t/how-do-i-sort-records-by-random-in-the-resource-action/58774 that looks like it would work. However, I get an error when I try.
My code:
The error I get
How do I use
My code:
The error I get
error: undefined function fragment/2 (expected MyModule to define such a function or for it to be imported, but none are available).How do I use
fragment in the prepare function? Or is there a better way to do this?