Replace usage of name in favor of displayname

This commit is contained in:
Sebastian Serth
2018-12-13 13:11:32 +01:00
parent b4b9ab48d0
commit 88081bb541
9 changed files with 13 additions and 30 deletions

View File

@ -4,28 +4,11 @@ class ExternalUser < ApplicationRecord
validates :consumer_id, presence: true
validates :external_id, presence: true
def name
# Internal name, shown to teachers and administrators
pseudo_name
end
def displayname
# External name, shown to the user itself and other users, e.g. on RfCs
pseudo_name
end
def real_name
# Name attribute of the object as persistet in the database
self[:name]
end
def pseudo_name
if real_name.blank?
if name.blank?
"User " + id.to_s
else
real_name
name
end
end
private :pseudo_name
end