View Source Flamel.Ecto (flamel v1.10.0)

A collection of helpers functions for Ecto

Summary

Functions

Test to see if an association is loaded or not

Functions

@spec loaded?(struct()) :: boolean()

Test to see if an association is loaded or not

The examples below use maps to mock Ecto schema structs

Examples

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