So Ecto has the Ecto.Changeset.get_change/3
function, and I’m honestly not sure what purpose it serves.
Here is the current code for this function:
@spec get_change(t, atom, term) :: term
def get_change(%Changeset{changes: changes} = _changeset, key, default \\ nil)
when is_atom(key) do
Map.get(changes, key, default)
end
I’m wondering if there’s really a reason to use it at all if it’s basically just a wrapper for Map.get/3
?
Am I missing something? Is there any disadvantage to just using changeset.changes
directly?
Thanks