I wrote this query:
from(
d in Doctor,
join: h in assoc(d, hospitals),
preload: [hospitals: :rooms, hospitals: :patients]
)
When I IO.inspect
it gives me preload like this in the console:
preload: [hospitals: [:patients], hospitals: [:rooms]]
If I use List.flatten
in preload, it gives me nested square brackets.
preload: [[hospitals: :patients, hospitals: :rooms]]
I want to return it like normal preload like this.
preload: [hospitals: :patients, hospitals: :rooms]
Why such behavior?
I am not running this query. I am just asserting it with the query my function is returning.
Any help will be much appreciated.
Thanks