2014-11-02 08:57:37 -08:00
|
|
|
module UserHelper
|
2014-11-10 22:09:36 -08:00
|
|
|
# Decides what user name to show.
|
|
|
|
# @return [String] The user name
|
2014-11-11 09:09:28 -08:00
|
|
|
def user_screen_name(user, anonymous=false)
|
|
|
|
return APP_CONFIG['anonymous_name'] if user.nil? || anonymous
|
2014-11-10 22:09:36 -08:00
|
|
|
return user.display_name unless user.display_name.blank?
|
|
|
|
user.screen_name
|
|
|
|
end
|
2014-11-02 08:57:37 -08:00
|
|
|
end
|