drhenner / ror_ecommerce

Ruby on Rails Ecommerce platform, perfect for your small business solution.
www.ror-e.com
MIT License
1.21k stars 409 forks source link

Referral email should be case_insensitive #198

Open jwjwyoung opened 5 years ago

jwjwyoung commented 5 years ago

https://github.com/drhenner/ror_ecommerce/blob/3db5a29000ac93d6b896469511004e450d019042/app/models/referral.rb#L10

with current validation code, I can create referrals with same email adrress with lowercase/uppercase as attached.

image

I believe here should use validates :email, presence: true, uniqueness: {case_sensitive: false}, format: { with: CustomValidators::Emails.email_validator }