ex_commons v0.1.1 ExCommons.Ecto.Changeset
Helpers for Ecto changeset
Link to this section Summary
Functions
Gets changes as a simple map from a changeset
Examples
Link to this section Functions
Link to this function
get_changes(change)
Gets changes as a simple map from a changeset
Examples
iex> ExCommons.Ecto.Changeset.get_changes(%{changes: %{some: :change}}) %{some: :change}
iex> changeset = %{changes: %{some: :change, other: %{changes: %{embed_change: true}}}} iex> ExCommons.Ecto.Changeset.get_changes(changeset) %{some: :change, other: %{embed_change: true}}
iex> changeset = %{changes: %{root: %{changes: %{one: %{changes: %{two: true}}}}}} iex> ExCommons.Ecto.Changeset.get_changes(changeset) %{root: %{one: %{two: true}}}