<commit_before>module ParticipatoryProcessFlags
  extend ActiveSupport::Concern

  class_methods do
    def ensure_participatory_process_flag(name, *options)
      before_filter(*options) do
        check_participatory_process_flag(name)
      end
    end
  end

  def check_participatory_process_flag(name)
    unless @participatory_process.send("feature_enabled?", name)
      redirect_to participatory_process_path(@participatory_process),
        notice: t('participatory_processes.flash.feature_disabled_notice')
    end
  end
end<commit_msg>Fix redirection if feature is not enabled (#576)<commit_after>module ParticipatoryProcessFlags
  extend ActiveSupport::Concern

  class_methods do
    def ensure_participatory_process_flag(name, *options)
      before_filter(*options) do
        check_participatory_process_flag(name)
      end
    end
  end

  def check_participatory_process_flag(name)
    unless participatory_process_step.send("feature_enabled?", name)
      redirect_to participatory_process_path(@participatory_process),
        notice: t('participatory_processes.flash.feature_disabled_notice')
    end
  end
end
{'fraction_non_alphanumeric': 0.06354810238305383, 'fraction_numerical': 0.00264783759929391, 'mean_word_length': 4.968421052631579, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6885161', 'n_tokens_mistral': 336, 'n_tokens_neox': 312, 'n_words': 60}