Fulib v0.1.11 Fulib.Validate View Source

Link to this section Summary

Link to this section Functions

Link to this function

unless_skipping(value, options, list) View Source

Link to this function

validate_changeset(changeset, rules \\ %{}) View Source

Link to this function

validate_value(value, value_type, rules \\ %{}) View Source

校验数据值

Params

value

value_type

数据类型: :integer, :string, :boolean, :float, :utc_datetime, and {:array, :xxx}

rules

  • :presence
  • :blank
  • :min_length
  • :max_length
  • :min_value
  • :max_value
  • :numericality
  • :format_with
  • :format_message
  • :format_email
  • :format_url
  • :format_integer
  • :format_pure_number
  • :inclusion
  • :exclusion
  • :acceptance
  • :trim
  • :chars