mirror of
https://github.com/mastodon/mastodon.git
synced 2025-09-05 17:31:12 +00:00
Use increment
for User#update_sign_in!
optional change (#35573)
This commit is contained in:
parent
6dc55a2f4e
commit
4042bc959b
|
@ -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…
Reference in New Issue
Block a user