feat(goals): gate Goals v2 behind beta features toggle

Add require_beta_features! to GoalsController and GoalPledgesController,
hide the Goals nav item for non-beta users, and tag index/show headers
with the Beta pill marker. Update controller tests to enable the
preference in setup and assert the redirect for users without access.
This commit is contained in:
Guillem Arias
2026-05-18 20:13:44 +02:00
parent ac23521c0a
commit 5c7babc44e
7 changed files with 36 additions and 6 deletions

View File

@@ -1,4 +1,5 @@
class GoalPledgesController < ApplicationController
before_action :require_beta_features!
before_action :set_goal
before_action :set_pledge, only: %i[renew destroy]
rescue_from ActiveRecord::RecordNotFound, with: :record_not_found

View File

@@ -1,4 +1,5 @@
class GoalsController < ApplicationController
before_action :require_beta_features!
before_action :set_goal, only: %i[show edit update destroy pause resume complete archive unarchive]
rescue_from ActiveRecord::RecordNotFound, with: :goal_not_found