class ProviderContact  < ApplicationRecord
  belongs_to :provider

  validates :email, format: { with: URI::MailTo::EMAIL_REGEXP, allow_blank: true }
  validates_format_of :phone, with: /\A[\\+\\\-\\\s\\(\\)\\: 0-9]*\z/i
  validates_format_of :first_name, with: /[a-zA-Z]/, if: -> {first_name.present?}
  validates_format_of :last_name, with: /[a-zA-Z]/, if: -> {last_name.present?}
end
