We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 186d396 commit 8c04908Copy full SHA for 8c04908
app/models/user.rb
@@ -36,7 +36,11 @@ class User < ActiveRecord::Base
36
length: { within: 2..50 }
37
38
validates :email, presence: true,
39
- uniqueness: { case_sensitive: false }
+ uniqueness: { case_sensitive: false },
40
+ format: {
41
+ with: URI::MailTo::EMAIL_REGEXP,
42
+ message: 'Only valid emails allowed'
43
+ }
44
45
validate :reject_common_login_mistakes, on: :create
46
0 commit comments