Skip to content

Commit

Permalink
attestation_template v2 : add feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
LeSim committed Nov 15, 2023
1 parent 791954a commit 9fc6c3b
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Administrateurs
class AttestationTemplateV2sController < AdministrateurController
before_action :retrieve_procedure, :retrieve_attestation_template
before_action :retrieve_procedure, :retrieve_attestation_template, :ensure_feature_active

def show
json_body = @attestation_template.json_body&.deep_symbolize_keys
Expand Down Expand Up @@ -33,6 +33,10 @@ def update

private

def ensure_feature_active
redirect_to root_path if !@procedure.feature_enabled?(:attestation_v2)
end

def retrieve_attestation_template
@attestation_template = @procedure.attestation_template || @procedure.build_attestation_template
end
Expand Down

0 comments on commit 9fc6c3b

Please sign in to comment.