A collection of helpers functions for Ecto
Test to see if an association is loaded or not
@spec loaded?(struct()) :: boolean()
The examples below use maps to mock Ecto schema structs
iex> user = %{profile: %{first_name: "Jill"}} iex> Flamel.Ecto.loaded?(user.profile) true iex> user = %{profile: %Ecto.Association.NotLoaded{}} iex> Flamel.Ecto.loaded?(user.profile) falsecopy
iex> user = %{profile: %{first_name: "Jill"}} iex> Flamel.Ecto.loaded?(user.profile) true iex> user = %{profile: %Ecto.Association.NotLoaded{}} iex> Flamel.Ecto.loaded?(user.profile) false