From 757c1a07a779b3df4e98074c632f5545095a0552 Mon Sep 17 00:00:00 2001
From: Parth <215315028+nystar1@users.noreply.github.com>
Date: Sun, 31 May 2026 22:46:30 +0530
Subject: [PATCH] feat(onboarding): allow any arbitrary
adult_ineligible_message in onboarding scenario
---
app/controllers/identities_controller.rb | 2 +-
app/models/onboarding_scenarios/base.rb | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/app/controllers/identities_controller.rb b/app/controllers/identities_controller.rb
index 14cd40e3..3ea84908 100644
--- a/app/controllers/identities_controller.rb
+++ b/app/controllers/identities_controller.rb
@@ -83,7 +83,7 @@ def create
if age >= 19 && !@onboarding_scenario.accepts_adults
track_event("signup.age_rejected", scenario: analytics_scenario, rejection_type: "too_old")
- @age_restriction = "Hack Club is a community for teenagers.
Unfortunately, you are not eligible to join.".html_safe
+ @age_restriction = @onboarding_scenario.adult_ineligible_message
@identity = Identity.new(@prefill_attributes.merge(attrs))
render :new, status: :unprocessable_entity
return
diff --git a/app/models/onboarding_scenarios/base.rb b/app/models/onboarding_scenarios/base.rb
index 1f081506..9d2bbac4 100644
--- a/app/models/onboarding_scenarios/base.rb
+++ b/app/models/onboarding_scenarios/base.rb
@@ -37,6 +37,8 @@ def next_action = :home
# Whether this scenario accepts adult (>18) users
def accepts_adults = false
+ def adult_ineligible_message = "Hack Club is a community for teenagers.
Unfortunately, you are not eligible to join.".html_safe
+
# Whether this scenario accepts users under 13
def accepts_under13 = false