Sha256: bc074f894a6455c87da720afc14f049ed6835f8436a3b4092e191ebad7867cce

Contents?: true

Size: 246 Bytes

Versions: 9

Compression:

Stored size: 246 Bytes

Contents

class EmailValidator < ActiveModel::EachValidator
  def validate_each(record,attribute,value)
    unless value =~ /\A[^@\s]+@([^@\s]+\.)+[^@\s]+\z/
      record.errors.add(attribute, :invalid, {:value => value}.merge!(options))
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
spree_core-2.1.12 lib/spree/core/validators/email.rb
spree_core-2.1.11 lib/spree/core/validators/email.rb
spree_core-2.1.10 lib/spree/core/validators/email.rb
spree_core-2.4.0.rc2 lib/spree/core/validators/email.rb
spree_core-2.4.0.rc1 lib/spree/core/validators/email.rb
spree_core-2.3.4 lib/spree/core/validators/email.rb
spree_core-2.1.9 lib/spree/core/validators/email.rb
spree_core-2.2.6 lib/spree/core/validators/email.rb
spree_core-2.3.3 lib/spree/core/validators/email.rb