Fix testimonial headings, category links on community domain#139
Open
Fix testimonial headings, category links on community domain#139
Conversation
Remove hard uniqueness constraint on heading (DB index + model validation) to prevent crashes when AI generates duplicate headings. Instead, deduplicate at display time — homepage selects one testimonial per unique heading via GROUP BY subquery. Improve generation prompt: allow 1-3 word headings with richer examples, raise temperature to 0.8, increase retries from 3 to 5, and gracefully save on exhausted retries instead of crashing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The previous MIN(id) approach always picked the same testimonial per heading. Use a window function with RANDOM() ordering so each page load gets a truly random testimonial per unique heading, all in a single query. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
GitHub users may not have a public email, causing failures when syncing GitHub data. Allow email to be nullable. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/showcaseonrubycommunity.orgwere hitting the user profile catch-all route instead of linking towhyruby.info/showcase. Wrappedcategory_path()withmain_site_url()in the shared layout nav. Fixes RorVsWild error (113 occurrences).headingthat crashedGenerateTestimonialFieldsJobwhen AI generated duplicates. Improved prompt (1-3 word headings, temperature 0.8, 5 retries, graceful fallback).MIN(id)grouping with aROW_NUMBER() OVER (PARTITION BY LOWER(heading) ORDER BY RANDOM())window function so each page load shows a truly random testimonial per unique heading.Test plan
rails test— 116 tests, 0 failures🤖 Generated with Claude Code