From 664817ac20ec2a3e338dc0b19e1d87e9c9896aed Mon Sep 17 00:00:00 2001 From: zaziemo Date: Tue, 23 Jul 2024 18:12:59 +0200 Subject: [PATCH] Quickfix: lookup for first topic is expensive since there are only 142 profiles that don't have one we will leave it empty for now and don't show anything. In the next steps we will migrate the data so every profile has a main topic again. --- app/models/profile.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/profile.rb b/app/models/profile.rb index 1ef12408b..2ed75baef 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -151,7 +151,9 @@ def name_or_email end def main_topic_or_first_topic - main_topic.present? ? main_topic : taggings.map { |tagging| tagging&.tag&.name }&.first + return nil unless main_topic + + main_topic end # Try building a slug based on the following fields in