-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(auth): Add user last login informations #3242
base: main
Are you sure you want to change the base?
Conversation
@@ -19,20 +27,26 @@ class User < ApplicationRecord | |||
has_many :subscriptions, through: :customers | |||
|
|||
validates :email, presence: true | |||
validates :password, presence: true | |||
validates :password, presence: true, on: :create |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want to allow empty passwords on update I think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will not override password if its nil? (since the password digest should stay)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the only other solution we have, is to disable validations for the update on the touch method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how can this validation fail on touch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it always fail and say that the password is empty, we do not have any password
field in DB thats why
last_login_at
andlast_login_method
password
only on users creation for validations (this made us unable to update a user)