Skip to content

Commit

Permalink
Remove Deprecated EmailValidator
Browse files Browse the repository at this point in the history
The email validator was deprecated Mar 15th 2018 almost 18 months ago
as part of: 6d8fd3c

The deprecation warning was part of v2.6.0rc1, and remains to this day
in v2.10.0.beta1 I think it's time to remove it altogether. It's been
4 minor version upgrades now.
  • Loading branch information
JDutil committed Oct 28, 2019
1 parent a591fdf commit cae386c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 25 deletions.
7 changes: 0 additions & 7 deletions core/lib/spree/core/validators/email.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,3 @@ def validate_each(record, attribute, value)
end
end
end

# @private
EmailValidator = ActiveSupport::Deprecation::DeprecatedConstantProxy.new(
'EmailValidator',
'Spree::EmailValidator',
message: "EmailValidator is deprecated! Use Spree::EmailValidator instead.\nChange `validates :email, email: true` to `validates :email, 'spree/email' => true`\n"
)
36 changes: 18 additions & 18 deletions core/spec/lib/spree/core/validators/email_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,27 @@ class Tester

let(:valid_emails) {
[
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]'
]
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]'
]
}
let(:invalid_emails) {
[
'invalid [email protected]',
'[email protected]',
'[email protected]',
'@email.com',
'[email protected]',
'invalidemailemail.com',
'@[email protected]',
'invalid@[email protected]',
'invalid.email@@email.com'
]
'invalid [email protected]',
'[email protected]',
'[email protected]',
'@email.com',
'[email protected]',
'invalidemailemail.com',
'@[email protected]',
'invalid@[email protected]',
'invalid.email@@email.com'
]
}

it 'validates valid email addresses' do
Expand Down

0 comments on commit cae386c

Please sign in to comment.