allow single quote inside email field (#2187)

Co-authored-by: romainnakedcat <romainnakedcat@greenserver.novalocal>
This commit is contained in:
RomainNakedCat 2020-10-13 16:20:34 +02:00 committed by GitHub
parent c77ae11ea0
commit ec4cde64ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -41,7 +41,7 @@ class User < ApplicationRecord
validate :check_if_email_can_be_blank
validates :email, length: { maximum: 256 }, allow_blank: true,
uniqueness: { case_sensitive: false, scope: :provider },
format: { with: /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i }
format: { with: /\A[\w+\-\'.]+@[a-z\d\-.]+\.[a-z]+\z/i }
validates :password, length: { minimum: 6 }, confirmation: true, if: :greenlight_account?, on: :create