Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Fixed email validator for Ruby 3.0

Damian Legawiecad8ba311000a
diff --git a/core/app/validators/email_validator.rb b/core/app/validators/email_validator.rb
index 771110d733..5a7822c6fe 100644
--- a/core/app/validators/email_validator.rb
+++ b/core/app/validators/email_validator.rb
@@ -1,7 +1,7 @@
class EmailValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
unless value =~ /\A[^@\s]+@[^@\s]+\z/
- record.errors.add(attribute, :invalid, { value: value }.merge!(options))
+ record.errors.add(attribute, :invalid, **{ value: value }.merge!(options))
end
end
end