<commit_before>require 'active_support'
require 'rapidfire'

Rails.application.config.to_prepare do

  Rapidfire::QuestionGroup.class_eval do
    has_paper_trail
    has_many :question_group_conditionals, foreign_key: 'rapidfire_question_group_id'
    has_many :cohorts, through: :question_group_conditionals
    has_and_belongs_to_many :surveys, join_table: 'surveys_question_groups', foreign_key: 'rapidfire_question_group_id'
  end

  Rapidfire::QuestionGroupsController.class_eval do
    before_action :set_tags, only: [:new, :edit]
<commit_msg>Restrict Access to QuestionGroup views to Admins<commit_after>require 'active_support'
require 'rapidfire'

Rails.application.config.to_prepare do

  Rapidfire::QuestionGroup.class_eval do
    has_paper_trail
    has_many :question_group_conditionals, foreign_key: 'rapidfire_question_group_id'
    has_many :cohorts, through: :question_group_conditionals
    has_and_belongs_to_many :surveys, join_table: 'surveys_question_groups', foreign_key: 'rapidfire_question_group_id'
  end

  Rapidfire::AnswerGroupsController.class_eval do
    before_action :require_admin_permissions
  end

  Rapidfire::QuestionGroupsController.class_eval do
    before_action :require_admin_permissions
    before_action :set_tags, only: [:new, :edit]

{'fraction_non_alphanumeric': 0.06953125, 'fraction_numerical': 0.0, 'mean_word_length': 7.1075949367088604, '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': '4126668', 'n_tokens_mistral': 425, 'n_tokens_neox': 416, 'n_words': 75}