Current section
Files
Jump to
Current section
Files
lib/validations/presence.ex
defmodule Gulib.Validations.Presence do
@moduledoc """
必须不能为空的校验
"""
def validate(value, options \\ []) do
Gulib.Validate.unless_skipping(value, options) do
if Gulib.blank?(value) do
{:fail, :not_present, Gulib.Translator.dgettext("validate", "Not Present")}
else
:ok
end
end
end
end