Skip to content

Commit

Permalink
Quickfix: lookup for first topic is expensive
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
zaziemo committed Jul 23, 2024
1 parent aaa5fdb commit 664817a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/models/profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 664817a

Please sign in to comment.