diff --git a/app/models/user.rb b/app/models/user.rb index cee659e67..2b4c2b43e 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -140,6 +140,14 @@ def update_without_password(params, *options) result end + def forum_username + username = self.username.present? ? "@#{self.username}" : nil + username ||= self.name.present? ? self.name : nil + username ||= 'Anonymous Author' + + username + end + private # Attributes that are non-public, and should be blacklisted from any public @@ -154,14 +162,6 @@ def blacklisted_attributes ] end - def forum_username - username = self.username.present? ? "@#{self.username}" : nil - username ||= self.name.present? ? self.name : nil - username ||= 'Anonymous Author' - - username - end - def deleted_at nil #hack end