diff --git a/app/helpers/user_helper.rb b/app/helpers/user_helper.rb index 3abe244b..ab35c452 100644 --- a/app/helpers/user_helper.rb +++ b/app/helpers/user_helper.rb @@ -3,7 +3,7 @@ module UserHelper # @return [String] The user name def user_screen_name(user, anonymous: false, url: true, link_only: false) return APP_CONFIG['anonymous_name'] if user.nil? || anonymous - name = user.display_name.blank? ? user.screen_name : user.display_name + name = user.profile.display_name.blank? ? user.screen_name : user.profile.display_name if url link = show_user_profile_path(user.screen_name) return link if link_only diff --git a/app/models/services/tumblr.rb b/app/models/services/tumblr.rb index d6631b9f..8af15e1d 100644 --- a/app/models/services/tumblr.rb +++ b/app/models/services/tumblr.rb @@ -32,7 +32,7 @@ class Services::Tumblr < Service asker = if answer.question.author_is_anonymous? APP_CONFIG['anonymous_name'] else - answer.question.user.display_name.blank? ? answer.question.user.screen_name : answer.question.user.display_name + answer.question.user.profile.display_name.blank? ? answer.question.user.screen_name : answer.question.user.profile.display_name end client.text( self.uid, diff --git a/app/views/discover/_userbox.haml b/app/views/discover/_userbox.haml index 8ae7567f..a34869a5 100644 --- a/app/views/discover/_userbox.haml +++ b/app/views/discover/_userbox.haml @@ -6,12 +6,12 @@ %img.avatar-md.mr-2{ src: u.profile_picture.url(:medium) } .media-body %h6.media-heading.answerbox__question-user - - if u.display_name.blank? + - if u.profile.display_name.blank? %a{ href: show_user_profile_path(u.screen_name) } = u.screen_name - else %a{ href: show_user_profile_path(u.screen_name) } - = u.display_name + = u.profile.display_name %span.text-muted= u.screen_name %p.answerbox__question-text - case type diff --git a/app/views/moderation/_userbox.haml b/app/views/moderation/_userbox.haml index 0b604f6d..7685622b 100644 --- a/app/views/moderation/_userbox.haml +++ b/app/views/moderation/_userbox.haml @@ -3,9 +3,9 @@ .card-body %img.userbox__avatar{ src: user.profile_picture.url(:small) } %a.profile__name{ href: show_user_profile_path(user.screen_name) } - - unless user.display_name.blank? + - unless user.profile.display_name.blank? .profile__display-name - = user.display_name + = user.profile.display_name .profile__screen-name = user.screen_name .row diff --git a/app/views/shared/_userbox.haml b/app/views/shared/_userbox.haml index a7325486..8ae9e144 100644 --- a/app/views/shared/_userbox.haml +++ b/app/views/shared/_userbox.haml @@ -4,9 +4,9 @@ .card-body %img.userbox__avatar{ src: user.profile_picture.url(:small) } %a.profile__name{ href: show_user_profile_path(user.screen_name) } - - unless user.display_name.blank? + - unless user.profile.display_name.blank? .profile__display-name - = user.display_name + = user.profile.display_name .profile__screen-name = user.screen_name = render 'user/actions', user: user, type: type diff --git a/app/views/user/_profile.haml b/app/views/user/_profile.haml index 8511cc56..ae9e809b 100644 --- a/app/views/user/_profile.haml +++ b/app/views/user/_profile.haml @@ -2,9 +2,9 @@ %img.profile__avatar{ src: user.profile_picture.url(:large) } .card-body .profile__name - - unless user.display_name.blank? + - unless user.profile.display_name.blank? .profile__display-name - = user.display_name + = user.profile.display_name .profile__screen-name = user.screen_name .profile__badge-container