<commit_before>class EventsController < ApplicationController
    #before_action :set_troop_event, only: [:show, :edit, :update, :destroy]
    before_action :set_event, only: [:show, :edit, :update, :destroy]
    before_action :authenticate_user!, only: [:new]
     autocomplete :badge, :name



  def index
    @events = Event.all
    @badges=Badge.all
    @age_levels = AgeLevel.all
    @skills = Skill.all
    @nature_skills = Skill.where(:category => "NATURE & ECOLOGY").order(name: :asc)
    @stem_skills = Skill.where(:category => "STEM").order(name: :asc)
    @business_skills = Skill.where(:category => "BUSINESS SMARTS").order(name: :asc)
    @general_skills = Skill.where(:category => "GENERAL").order(name: :asc)
  end

  def show
    @skills = Skill.all
  end

  def new
    if current_user.admin_privileges < 50
      @event = Event.new
      @event_badge = EventBadge.new
      @troop_event = TroopEvent.new
      @badges=Badge.all
      @age_levels = AgeLevel.all
      @troops = Troop.all
      @skills = Skill.order(name: :asc)
    else
      redirect_to events_path
    end<commit_msg>made changes to get nature and ecology skills to populate<commit_after>class EventsController < ApplicationController
    #before_action :set_troop_event, only: [:show, :edit, :update, :destroy]
    before_action :set_event, only: [:show, :edit, :update, :destroy]
    before_action :authenticate_user!, only: [:new]
     autocomplete :badge, :name



  def index
    @events = Event.all
    @badges=Badge.all
    @age_levels = AgeLevel.all
    @skills = Skill.all
    @nature_skills = Skill.where(:category => "NATURE AND ECOLOGY").order(name: :asc)
    @stem_skills = Skill.where(:category => "STEM").order(name: :asc)
    @business_skills = Skill.where(:category => "BUSINESS SMARTS").order(name: :asc)
    @general_skills = Skill.where(:category => "GENERAL").order(name: :asc)
  end

  def show
    @skills = Skill.all
  end

  def new
    if current_user.admin_privileges < 50
      @event = Event.new
      @event_badge = EventBadge.new
      @troop_event = TroopEvent.new
      @badges=Badge.all
      @age_levels = AgeLevel.all
      @troops = Troop.all
      @skills = Skill.order(name: :asc)
    else
      redirect_to events_path
    end
{'fraction_non_alphanumeric': 0.12566607460035523, 'fraction_numerical': 0.0017761989342806395, 'mean_word_length': 3.4350393700787403, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '803897', 'n_tokens_mistral': 812, 'n_tokens_neox': 771, 'n_words': 169}