fix email regex in Supplier (\A,\z vs ^,$)

new_user
JuliusR 8 months ago
parent cbcf042992
commit c135679992
  1. 2
      app/models/supplier.rb

@ -7,7 +7,7 @@ class Supplier < ActiveRecord::Base
serialize :lists
FTP_TYPES = ['bnn', 'foodsoft'].freeze
EMAIL_RE = /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i.freeze
EMAIL_RE = /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i.freeze
validates :name, :address, :phone, presence: true
validates :ftp_host, :ftp_user, :ftp_password, :ftp_sync, presence: true, if: :ftp_sync?

Loading…
Cancel
Save