Skip to content

Multiple validations per parameter #4

@tarolandia

Description

@tarolandia

Improve Hatch to allow multiple validations for each parameter/property.

class LoginForm
  include Hatch

  certify('email', 'must_be_present') do |email|
    !email.nil? && !email.empty?
  end

  certify('email', 'email_must_exist') do |email|
    # example using sequel
    !User.find(email: email).nil?
  end

This feature will allow the developer to use multiple error messages when validating.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions