Skip to content

Commit 88ac6c2

Browse files
committed
Session generator: Normalize email_address
Normalizes email_address before saving it to the DB.
1 parent 4294d71 commit 88ac6c2

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 validations: false
33
has_many :sessions, dependent: :destroy
4+
5+
normalizes :email_address, with: -> { _1.strip.downcase }
46
end

0 commit comments

Comments
 (0)