Sha256: 1f83c123b04035950e8a24fa6b5510c52980b761f908e67bae1ae066e1daa9f0
Contents?: true
Size: 541 Bytes
Versions: 24
Compression:
Stored size: 541 Bytes
Contents
# frozen_string_literal: true module Spree # == An ActiveModel Email Validator # # === Usage # # require 'spree/core/validators/email' # # class Person < ApplicationRecord # validates :email_address, 'spree/email' => true # end # class EmailValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) unless Spree::Config.default_email_regexp.match? value record.errors.add(attribute, :invalid, **{ value: value }.merge!(options)) end end end end
Version data entries
24 entries across 24 versions & 1 rubygems