diff --git a/app/models/user.rb b/app/models/user.rb index fb1d8e1227..30ed40edee 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -126,7 +126,6 @@ class User < ApplicationRecord enum email_status: %i[email_unconfirmed email_confirmed email_bounced] enum title_language_preference: %i[canonical romanized localized] - rolify after_add: :update_title, after_remove: :update_title flag :permissions, %i[admin community_mod database_mod] has_secure_password validations: false update_index('users#user') { self } @@ -345,7 +344,7 @@ def alts alts.sort_by { |_, v| v }.reverse end - def update_title(_role) + def update_title if permissions.admin? update(title: 'Staff') elsif permissions.database_mod? || permissions.community_mod? @@ -431,6 +430,7 @@ def update_profile_completed! end self.previous_email = nil if confirmed_at_changed? self.previous_email = email_was if email_changed? + update_title update_profile_completed update_feed_completed end