defmodule Project.Helpers.Error do
@doc """
This method is used to extract changeset information for putting into flash notices
"""
def extract_changeset_error(changeset) do
[ {field, {description, [{_, validation} | _]}} | _] = changeset.errors
Macro.camelize("#{field} #{description}. It is #{validation}. ")
end
end