<commit_before>class ListsController < ApplicationController
  respond_to :js

  # POST /lists
  #----------------------------------------------------------------------------
  def create
    @list = List.new(params[:list])
    @list.save
    respond_with(@list)
  end

  # DELETE /lists/1
  #----------------------------------------------------------------------------
  def destroy
    #TODO
  end
end
<commit_msg>Added logic to lists controller so that existing names will be overwritten<commit_after>class ListsController < ApplicationController
  respond_to :js

  # POST /lists
  #----------------------------------------------------------------------------
  def create
    return unless params[:list]
    # Find any existing list with the same name (case insensitive)
    if @list = List.find(:first, :conditions => ["lower(name) = ?", params[:list][:name].downcase])
      @list.update_attributes(params[:list])
    else
      @list = List.create(params[:list])
    end
    respond_with(@list)
  end

  # DELETE /lists/1
  #----------------------------------------------------------------------------
  def destroy
    #TODO
  end
end

{'fraction_non_alphanumeric': 0.34353146853146854, 'fraction_numerical': 0.0017482517482517483, 'mean_word_length': 1.2718253968253967, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '2629584', 'n_tokens_mistral': 277, 'n_tokens_neox': 269, 'n_words': 74}