Appease the dog overlords
This commit is contained in:
parent
0196a9ea10
commit
15052e203e
|
@ -3,7 +3,7 @@ require 'cgi'
|
|||
module SocialHelper::TumblrMethods
|
||||
def tumblr_title(answer)
|
||||
asker = if answer.question.author_is_anonymous?
|
||||
answer.user.profile.anon_display_name.presence || APP_CONFIG['anonymous_name']
|
||||
answer.user.profile.anon_display_name.presence || APP_CONFIG["anonymous_name"]
|
||||
else
|
||||
answer.question.user.profile.safe_name
|
||||
end
|
||||
|
|
|
@ -3,7 +3,7 @@ module UserHelper
|
|||
# @param context_user [User] the user whose the profile preferences should be applied
|
||||
# @return [String] The user name
|
||||
def user_screen_name(user, context_user: nil, anonymous: false, url: true, link_only: false)
|
||||
return context_user&.profile&.anon_display_name.presence || APP_CONFIG['anonymous_name'] if user.nil? || anonymous
|
||||
return anonymous_name(context_user) if user.nil? || anonymous
|
||||
|
||||
name = user.profile.display_name.presence || user.screen_name
|
||||
if url
|
||||
|
@ -14,4 +14,10 @@ module UserHelper
|
|||
end
|
||||
name.strip
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def anonymous_name(context_user)
|
||||
context_user&.profile&.anon_display_name.presence || APP_CONFIG["anonymous_name"]
|
||||
end
|
||||
end
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
|
||||
= f.text_field :motivation_header
|
||||
|
||||
= f.text_field :anon_display_name, placeholder: APP_CONFIG[:anonymous_name]
|
||||
= f.text_field :anon_display_name, placeholder: APP_CONFIG["anonymous_name"]
|
||||
|
||||
= f.text_field :website
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddAnonDisplayNameToProfiles < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :profiles, :anon_display_name, :string
|
||||
|
|
Loading…
Reference in New Issue