mirror of
https://github.com/yingziwu/mastodon.git
synced 2026-02-17 07:43:17 +00:00
Use increment for User#update_sign_in! optional change (#35573)
This commit is contained in:
parent
6dc55a2f4e
commit
4042bc959b
1 changed files with 1 additions and 4 deletions
|
|
@ -228,10 +228,7 @@ class User < ApplicationRecord
|
|||
self.last_sign_in_at = old_current || new_current
|
||||
self.current_sign_in_at = new_current
|
||||
|
||||
if new_sign_in
|
||||
self.sign_in_count ||= 0
|
||||
self.sign_in_count += 1
|
||||
end
|
||||
increment(:sign_in_count) if new_sign_in
|
||||
|
||||
save(validate: false) unless new_record?
|
||||
prepare_returning_user!
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue