From 07656775553958a85d11e72cb0f75872b38ef219 Mon Sep 17 00:00:00 2001 From: nilsding Date: Tue, 11 Nov 2014 07:09:36 +0100 Subject: [PATCH] added a helper! --- app/helpers/user_helper.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/helpers/user_helper.rb b/app/helpers/user_helper.rb index 0147c3fe..1c5f57fb 100644 --- a/app/helpers/user_helper.rb +++ b/app/helpers/user_helper.rb @@ -1,2 +1,9 @@ module UserHelper + # Decides what user name to show. + # @return [String] The user name + def user_screen_name(user) + return APP_CONFIG['anonymous_name'] if user.nil? + return user.display_name unless user.display_name.blank? + user.screen_name + end end