From 833a1b9f86a55ccf66e8427d080772659e66f277 Mon Sep 17 00:00:00 2001 From: Emma Lejeck Date: Sat, 31 Oct 2020 15:21:43 -0700 Subject: [PATCH] Fix User#update_title for non-rolify stuff --- app/models/user.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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