Skip to content

Commit a7796bd

Browse files
authored
Merge pull request rails#52379 from dixpac/dix/normalize_auth_email
Session generator: Normalize email_address
2 parents 7e3c9b8 + 88ac6c2 commit a7796bd

File tree

1 file changed

+2
-0
lines changed
  • railties/lib/rails/generators/rails/authentication/templates/models

1 file changed

+2
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
class User < ApplicationRecord
22
has_secure_password
33
has_many :sessions, dependent: :destroy
4+
5+
normalizes :email_address, with: -> { _1.strip.downcase }
46
end

0 commit comments

Comments
 (0)