<commit_before>class QuotesController < ApplicationController
  helper_method :quotes_collection

  def index
    @quotes = Quote.all
  end

  def show
    @quote = Quote.find_by_uuid params[:id]

    respond_to do |format|
      format.html
      format.pdf do
        render :pdf => "quote.pdf", :print_media_type => true
      end
    end
  end

  def new
    @quote = Quote.new
    @clone = params[:clone]
  end

  def create
    attributes = params[:quote]
    uuid = attributes.delete(:clone)
    original = Quote.find_by_uuid(uuid)

    if original
      @quote = original.dup_branch
      @quote.attributes = @quote.attributes.merge(attributes)
    else
      @quote = Quote.new(attributes)
    end

    if @quote.save
      redirect_to @quote
    else
      flash.now.alert = 'There were some errors.'
      render :new
    end
  end<commit_msg>changed quotes to default to processed = false, even if cloned from a previously imported quote<commit_after>class QuotesController < ApplicationController
  helper_method :quotes_collection

  def index
    @quotes = Quote.all
  end

  def show
    @quote = Quote.find_by_uuid params[:id]

    respond_to do |format|
      format.html
      format.pdf do
        render :pdf => "quote.pdf", :print_media_type => true
      end
    end
  end

  def new
    @quote = Quote.new
    @clone = params[:clone]
  end

  def create
    attributes = params[:quote]
    uuid = attributes.delete(:clone)
    original = Quote.find_by_uuid(uuid)

    if original
      @quote = original.dup_branch
      @quote.attributes = @quote.attributes.merge(attributes)
    else
      @quote = Quote.new(attributes)
    end

    @quote.processed = false

    if @quote.save
      redirect_to @quote
    else
      flash.now.alert = 'There were some errors.'
      render :new
    end
  end
{'fraction_non_alphanumeric': 0.08516483516483517, 'fraction_numerical': 0.0, 'mean_word_length': 2.5359223300970872, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '2538862', 'n_tokens_mistral': 568, 'n_tokens_neox': 550, 'n_words': 151}