mirror of
https://github.com/manyfold3d/manyfold.git
synced 2026-10-23 12:12:21 -05:00
8 lines
212 B
Ruby
8 lines
212 B
Ruby
require "uri"
|
|
|
|
class EmailValidator < ActiveModel::Validator
|
|
def validate(record)
|
|
record.errors.add(:email, I18n.t("errors.messages.invalid")) unless record.email.match? URI::MailTo::EMAIL_REGEXP
|
|
end
|
|
end
|