Current section
Files
Jump to
Current section
Files
lib/kitchensink.ex
defmodule Ondix.Kitchensink do
def flow() do
[
Ondix.Entities.Artiste,
Ondix.Entities.ArtisteType,
Ondix.Entities.Compositeur,
Ondix.Entities.Concert,
Ondix.Entities.Distribution,
Ondix.Entities.Genre,
Ondix.Entities.Lieu,
Ondix.Entities.Oeuvre,
Ondix.Entities.Representation,
Ondix.Entities.Saison
]
|> Enum.map(fn mod -> Task.async(fn -> [mod.get(1, []), mod.list([], 0)] end) end)
|> Enum.map(fn task -> Task.await(task) end)
|> List.flatten
|> Enum.map(&clean_collections/1)
end
def clean_collections(%Ondix.Collection{} = c), do: %Ondix.Collection{c | data: [List.first(c.data)]}
def clean_collections(a), do: a
end