<commit_before>class Admin::FestivalsController < Admin::AdminAreaController
  before_action :set_admin_festival, only: [:show, :edit, :update, :destroy]

  # GET /admin/festivals
  # GET /admin/festivals.json
  def index
    @admin_festivals = Festival.all
    @page_title = "Festival"
  end

  # GET /admin/festivals/1
  # GET /admin/festivals/1.json
  def show
    @page_title = @admin_festival.title
  end

  # GET /admin/festivals/new
  def new
    @admin_festival = Festival.new
    @page_title = "New Festival"
  end

  # GET /admin/festivals/1/edit
  def edit
    @page_title = "Edit Event: #{@admin_festival.title}"
  end

  # POST /admin/festivals
  # POST /admin/festivals.json
  def create
    @admin_festival = Festival.new(admin_festival_params)
    @admin_festival = Event.new(event_params)
    @admin_festival.date = @admin_festival.date.strftime("%m/%d/%Y")
    if @admin_festival.end_date.present?
      @admin_festival.end_date = @admin_festival.end_date.strftime("%m/%d/%Y")
    end

    respond_to do |format|
      if @admin_festival.save
        format.html { redirect_to @admin_festival, notice: 'Festival was successfully created.' }
      else
        format.html { render :new }
      end
    end
  end

  # PATCH/PUT /admin/festivals/1
  # PATCH/PUT /admin/festivals/1.json
  def update
    respond_to do |format|
      if @admin_festival.update(admin_festival_params)
        format.html { redirect_to @admin_festival, notice: 'Festival was successfully updated.' }
      else
        format.html { render :edit }
      end
    end
  end

  # DELETE /admin/festivals/1
  # DELETE /admin/festivals/1.json
  def destroy
    @admin_festival.destroy
    respond_to do |format|
      format.html { redirect_to admin_festivals_url, notice: 'Festival was successfully destroyed.' }
    end
  end

  private
    # Use callbacks to share common setup or constraints between actions.<commit_msg>Keeps admin in admin area after festival actions<commit_after>class Admin::FestivalsController < Admin::AdminAreaController
  before_action :set_admin_festival, only: [:show, :edit, :update, :destroy]

  # GET /admin/festivals
  # GET /admin/festivals.json
  def index
    @admin_festivals = Festival.all
    @page_title = "Festival"
  end

  # GET /admin/festivals/1
  # GET /admin/festivals/1.json
  def show
    @page_title = @admin_festival.title
  end

  # GET /admin/festivals/new
  def new
    @admin_festival = Festival.new
    @page_title = "New Festival"
  end

  # GET /admin/festivals/1/edit
  def edit
    @page_title = "Edit Event: #{@admin_festival.title}"
  end

  # POST /admin/festivals
  # POST /admin/festivals.json
  def create
    @admin_festival = Festival.new(admin_festival_params)
    @admin_festival.date = @admin_festival.date.strftime("%m/%d/%Y")
    if @admin_festival.end_date.present?
      @admin_festival.end_date = @admin_festival.end_date.strftime("%m/%d/%Y")
    end

    respond_to do |format|
      if @admin_festival.save
        format.html { redirect_to admin_festival_path(@admin_festival), notice: 'Festival was successfully created.' }
      else
        format.html { render :new }
      end
    end
  end

  # PATCH/PUT /admin/festivals/1
  # PATCH/PUT /admin/festivals/1.json
  def update
    respond_to do |format|
      if @admin_festival.update(admin_festival_params)
        format.html { redirect_to admin_festival_path(@admin_festival), notice: 'Festival was successfully updated.' }
      else
        format.html { render :edit }
      end
    end
  end

  # DELETE /admin/festivals/1
  # DELETE /admin/festivals/1.json
  def destroy
    @admin_festival.destroy
    respond_to do |format|
      format.html { redirect_to admin_festivals_url, notice: 'Festival was successfully destroyed.' }
    end
  end

  private
    # Use callbacks to share common setup or constraints between actions.
{'fraction_non_alphanumeric': 0.1002850479398808, 'fraction_numerical': 0.003627882871210158, 'mean_word_length': 3.132762312633833, 'pattern_counts': {'":': 0, '<': 5, '<?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': '815629', 'n_tokens_mistral': 1318, 'n_tokens_neox': 1263, 'n_words': 290}