<commit_before>class PerformancesController < ApplicationController
    before_filter :authenticate_user!, :only => [:create, :edit, :destroy, :update]
  def new
      @show = Show.find(params[:show_id])
      @performance = Performance.new()
      @venues = Venue.all
  end

  def create
      @performance = Performance.new(params[:performance])
      @show = Show.find(params[:performance][:show_id])
    respond_to do |format|
      if @performance.save
        format.html { redirect_to @performance, notice: 'Performance was successfully created.' }
        format.json { render json: @performance, status: :created, location: @performance }
      else
        format.html { render action: "new" }
        format.json { render json: @performance.errors, status: :unprocessable_entity }
      end
    end
  end

  def index
      @date = params[:date] ? Date.parse(params[:date]) : Performance.minimum(:date).to_date
      @performances_by_date = Performance.all.group_by { |p| p.date.to_date }
      @performance = Performance.first<commit_msg>home page defaults to current date if all events are in the past<commit_after>class PerformancesController < ApplicationController
    before_filter :authenticate_user!, :only => [:create, :edit, :destroy, :update]
  def new
      @show = Show.find(params[:show_id])
      @performance = Performance.new()
      @venues = Venue.all
  end

  def create
      @performance = Performance.new(params[:performance])
      @show = Show.find(params[:performance][:show_id])
    respond_to do |format|
      if @performance.save
        format.html { redirect_to @performance, notice: 'Performance was successfully created.' }
        format.json { render json: @performance, status: :created, location: @performance }
      else
        format.html { render action: "new" }
        format.json { render json: @performance.errors, status: :unprocessable_entity }
      end
    end
  end

  def index
      @date = params[:date] ? Date.parse(params[:date]) : [Performance.minimum(:date).to_date,Date.today.to_date].max
      @performances_by_date = Performance.all.group_by { |p| p.date.to_date }
      @performance = Performance.first
{'fraction_non_alphanumeric': 0.11672794117647059, 'fraction_numerical': 0.0, 'mean_word_length': 3.4794238683127574, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '515685', 'n_tokens_mistral': 648, 'n_tokens_neox': 613, 'n_words': 155}