Packages

Internal utils and helper snippets used across our internal projects. Copy and re-use as you like.

Current section

Files

Jump to
omtt_util lib util_changeset.ex
Raw

lib/util_changeset.ex

defmodule OMTT.Util.Changeset do
import Ecto.Changeset, only: [update_change: 3]
def lowercase_field(changeset, fieldname) when is_atom(fieldname) do
update_change(changeset, fieldname, &String.downcase/1)
end
end