diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index e0a2c4422..58b3e12d6 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -2,10 +2,4 @@ module UsersHelper def prepend_current_user_to(users_scope) users_scope.to_a.prepend(Current.user).uniq end - - def familiar_name_for(user) - names = user.name.split - return user.name if names.length == 1 - "#{names.first} #{names[1..].map { |n| "#{n[0]}." }.join}" - end end diff --git a/app/models/user/named.rb b/app/models/user/named.rb index 67420ec72..aa4f9b585 100644 --- a/app/models/user/named.rb +++ b/app/models/user/named.rb @@ -16,4 +16,10 @@ module User::Named def initials name.scan(/\b\p{L}/).join.upcase end + + def familiar_name + names = name.split + return name if names.length == 1 + "#{names.first} #{names[1..].map { |n| "#{n[0]}." }.join}" + end end diff --git a/app/views/cards/display/common/_background.html.erb b/app/views/cards/display/common/_background.html.erb index 8852fb765..4db6a088a 100644 --- a/app/views/cards/display/common/_background.html.erb +++ b/app/views/cards/display/common/_background.html.erb @@ -6,6 +6,6 @@