All,
I’m currently struggling to sort relationships loaded from a resource.
E.g. a resource “Domain” has multiple “Controls”.
Getting a domain and preload the controls is easy and works just fine:
Domain.get_by_identifier!(identifier, load: :controls)
However I’m struggling with getting those controls as sorted list. My gut feeling is that this should be possible because the Api.load/3
function also accepts [atom() | {atom(), atom() | Keyword.t()}]
as load_statement
type. This would allow for something like
Domain.get_by_identifier!(identifier, load: [{:controls, [identifier: asc]}])
This doesn’t work though
Any pointers?
CU,
Udo