fallback for when nick is nil

This commit is contained in:
wvengen 2013-10-29 18:58:04 +01:00
parent e968919cce
commit 9ba425aafa
6 changed files with 12 additions and 6 deletions

View file

@ -170,7 +170,8 @@ module ApplicationHelper
elsif options[:full]
"#{user.nick} (#{user.first_name} #{user.last_name})"
else
user.nick
# when use_nick was changed from false to true, users may exist without nick
user.nick.nil? ? I18n.t('helpers.application.nick_fallback') : user.nick
end
else
"#{user.first_name} #{user.last_name}" + (options[:unique] ? " (\##{user.id})" : '')