<commit_before>class EventConfigurationsController < ApplicationController
  before_filter :authenticate_user!, :except => [:logo]
  before_filter :load_event_configuration, :only => [:create]
  load_and_authorize_resource


  def load_event_configuration
    @event_configuration = EventConfiguration.new(event_configuration_params)
  end

  # GET /event_configurations/1/logo
  def logo
    @event_configuration = EventConfiguration.find(params[:id])
    @image = @event_configuration.logo_binary
    send_data @image, :type => @event_configuration.logo_type,
               :filename => @event_configuration.logo_filename,
               :disposition => 'inline'
  end

  # GET /event_configurations
  # GET /event_configurations.json
  def index
    @event_configurations = EventConfiguration.all

    respond_to do |format|
      format.html # index.html.erb
      format.json { render json: @event_configurations }
    end
  end

  # GET /event_configurations/new
  # GET /event_configurations/new.json
  def new

    respond_to do |format|
      format.html # new.html.erb
      format.json { render json: @event_configuration }
    end
  end

  # GET /event_configurations/1/edit
  def edit
  end

  # POST /event_configurations
  # POST /event_configurations.json<commit_msg>update logo controller to only attempt to show a logo if one is stored<commit_after>class EventConfigurationsController < ApplicationController
  before_filter :authenticate_user!, :except => [:logo]
  before_filter :load_event_configuration, :only => [:create]
  load_and_authorize_resource


  def load_event_configuration
    @event_configuration = EventConfiguration.new(event_configuration_params)
  end

  # GET /event_configurations/1/logo
  def logo
    @event_configuration = EventConfiguration.find(params[:id])
    @image = @event_configuration.logo_binary

    if @event_configuration.logo_type.nil?
      render nothing: true
    else
      send_data @image, :type => @event_configuration.logo_type,
        :filename => @event_configuration.logo_filename,
        :disposition => 'inline'
    end
  end

  # GET /event_configurations
  # GET /event_configurations.json
  def index
    @event_configurations = EventConfiguration.all

    respond_to do |format|
      format.html # index.html.erb
      format.json { render json: @event_configurations }
    end
  end

  # GET /event_configurations/new
  # GET /event_configurations/new.json
  def new

    respond_to do |format|
      format.html # new.html.erb
      format.json { render json: @event_configuration }
    end
  end

  # GET /event_configurations/1/edit
  def edit
  end

  # POST /event_configurations
  # POST /event_configurations.json
{'fraction_non_alphanumeric': 0.08108108108108109, 'fraction_numerical': 0.001480932987782303, 'mean_word_length': 3.6747404844290656, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '6196083', 'n_tokens_mistral': 809, 'n_tokens_neox': 781, 'n_words': 177}