mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-03 02:21:33 +00:00
Merge pull request #7886 from apricot12/invalid_customer_email_subscription_fail
Add valid_email2 gem for email validation to fix subscription failures with invalid emails.
This commit is contained in:
2
Gemfile
2
Gemfile
@@ -25,6 +25,8 @@ gem "activerecord-import"
|
||||
gem "db2fog", github: "openfoodfoundation/db2fog", branch: "rails-6"
|
||||
gem "fog-aws", "~> 2.0" # db2fog does not support v3
|
||||
|
||||
gem "valid_email2"
|
||||
|
||||
gem "catalog", path: "./engines/catalog"
|
||||
gem 'dfc_provider', path: './engines/dfc_provider'
|
||||
gem "order_management", path: "./engines/order_management"
|
||||
|
||||
@@ -633,6 +633,9 @@ GEM
|
||||
get_process_mem (~> 0)
|
||||
unicorn (>= 4, < 7)
|
||||
uniform_notifier (1.14.2)
|
||||
valid_email2 (4.0.0)
|
||||
activemodel (>= 3.2)
|
||||
mail (~> 2.5)
|
||||
view_component (2.35.0)
|
||||
activesupport (>= 5.0.0, < 8.0)
|
||||
method_source (~> 1.0)
|
||||
@@ -792,6 +795,7 @@ DEPENDENCIES
|
||||
uglifier (>= 1.0.3)
|
||||
unicorn-rails
|
||||
unicorn-worker-killer
|
||||
valid_email2
|
||||
view_component
|
||||
view_component_storybook
|
||||
web!
|
||||
|
||||
@@ -20,7 +20,7 @@ class Customer < ApplicationRecord
|
||||
before_validation :empty_code
|
||||
|
||||
validates :code, uniqueness: { scope: :enterprise_id, allow_nil: true }
|
||||
validates :email, presence: true,
|
||||
validates :email, presence: true, 'valid_email_2/email': true,
|
||||
uniqueness: { scope: :enterprise_id, message: I18n.t('validation_msg_is_associated_with_an_exising_customer') }
|
||||
validates :enterprise, presence: true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user