Swiss.Ecto (swiss v3.12.0) View Source
Generic helper functions related with Ecto.
Link to this section Summary
Functions
Given an association field, returns whether it's preloaded.
Link to this section Functions
Specs
Given an association field, returns whether it's preloaded.
Examples
iex> Swiss.Ecto.assoc_present?(nil)
false
iex> Swiss.Ecto.assoc_present?(nil, true)
true
iex> Swiss.Ecto.assoc_present?(%Ecto.Association.NotLoaded{})
false
iex> Swiss.Ecto.assoc_present?([])
true
iex> Swiss.Ecto.assoc_present?(MapSet.new())
true