Feature Description
Suggested Solution
I have been foiled too many times by forgetting to downcase emails prior to saving or when comparing on find. Thoughts on adding an email or downcase parser that downcases, and could also do some other fun email regex?
the regex bit may be a bit much, although there are examples here as well as a lengthy discussion on the pros and cons / challenges:
https://stackoverflow.com/questions/38611405/email-validation-in-ruby-on-rails
Curious if people have solved this in other ways!
Alternatives Considered / Existing Workarounds
- custom parser, other model code to support, html
email input for type validation
Additional Context
In other apps I do have code like:
validates :email, presence: true, uniqueness: { case_sensitive: false } on models with email fields
as well as this:
def self.find_for_authentication(email)
find_by('lower(email) = ?', email.try(:downcase))
end
since we did have some mismatch of cases at one time
Feature Description
Suggested Solution
I have been foiled too many times by forgetting to downcase emails prior to saving or when comparing on
find. Thoughts on adding anemailordowncaseparser that downcases, and could also do some other fun email regex?the regex bit may be a bit much, although there are examples here as well as a lengthy discussion on the pros and cons / challenges:
https://stackoverflow.com/questions/38611405/email-validation-in-ruby-on-rails
Curious if people have solved this in other ways!
Alternatives Considered / Existing Workarounds
emailinput for type validationAdditional Context
In other apps I do have code like:
validates :email, presence: true, uniqueness: { case_sensitive: false }on models with email fieldsas well as this:
since we did have some mismatch of cases at one time