Skip to content

Fix testimonial headings, category links on community domain#139

Open
newstler wants to merge 3 commits intomainfrom
fix/headings-taken-and-categoty-links
Open

Fix testimonial headings, category links on community domain#139
newstler wants to merge 3 commits intomainfrom
fix/headings-taken-and-categoty-links

Conversation

@newstler
Copy link
Owner

Summary

  • Fix category links on community domain: Navigation links like /showcase on rubycommunity.org were hitting the user profile catch-all route instead of linking to whyruby.info/showcase. Wrapped category_path() with main_site_url() in the shared layout nav. Fixes RorVsWild error (113 occurrences).
  • Fix testimonial heading collisions: Removed hard uniqueness constraint on heading that crashed GenerateTestimonialFieldsJob when AI generated duplicates. Improved prompt (1-3 word headings, temperature 0.8, 5 retries, graceful fallback).
  • Fix homepage testimonial randomness: Replaced deterministic MIN(id) grouping with a ROW_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
  • RuboCop — no offenses
  • Brakeman — no warnings
  • Verify category nav links on rubycommunity.org point to whyruby.info
  • Verify homepage testimonials show different selections on refresh

🤖 Generated with Claude Code

newstler and others added 3 commits February 12, 2026 15:23
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant