#701 ✓not-applicable
Jon Hancock

expose email validation as generic helper

Reported by Jon Hancock | December 8th, 2008 @ 04:11 PM

Sometimes I need to validate an email format outside of the context of a model.
I have looked through DataMapper::Validate::Format::Email and cannot see how I might be able to write my own helper method to call this validation logic on its own.
It would be very nice if I could write a method something like this:

def validate_email(email)
  # returns true or false
  DataMapper::Validate::FormatValidator.validate(some_email, :format => :email)

There are other ways I could roll my own email validation, but I would very much like to use the same logic as is used in subsequent model validations.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket