<commit_before>class Admin::ProductDatasheetsController < Admin::BaseController
  def index
    @product_datasheets = ProductDatasheet.not_deleted
  end
  
  def new
    @product_datasheet = ProductDatasheet.new
    render :layout => false
  end
  
  def show
    @product_datasheet = ProductDatasheet.find(params[:id])
    send_file @product_datasheet.xls.path
  end
  
  def upload
  end
  
  def edit
  end
  
  def destroy
    @product_datasheet = ProductDatasheet.find(params[:id])
    @product_datasheet.deleted_at = Time.now
    if @product_datasheet.save
      flash.notice = I18n.t("notice_messages.product_datasheet_deleted")
    else
      @product_datasheet.errors.add_to_base('Failed to delete the product datasheet')
    end
    redirect_to admin_product_datasheets_path(:format => :html)
  end
  
  def clone
  end
  
  def collection
    return @collection if @collection
    <commit_msg>Enabling paths that are not root relative (S3 and such)<commit_after>class Admin::ProductDatasheetsController < Admin::BaseController
  def index
    @product_datasheets = ProductDatasheet.not_deleted
  end
  
  def new
    @product_datasheet = ProductDatasheet.new
    render :layout => false
  end
  
  def show
    @product_datasheet = ProductDatasheet.find(params[:id])
    send_file @product_datasheet.xls
  end
  
  def upload
  end
  
  def edit
  end
  
  def destroy
    @product_datasheet = ProductDatasheet.find(params[:id])
    @product_datasheet.deleted_at = Time.now
    if @product_datasheet.save
      flash.notice = I18n.t("notice_messages.product_datasheet_deleted")
    else
      @product_datasheet.errors.add_to_base('Failed to delete the product datasheet')
    end
    redirect_to admin_product_datasheets_path(:format => :html)
  end
  
  def clone
  end
  
  def collection
    return @collection if @collection
    
{'fraction_non_alphanumeric': 0.07100271002710028, 'fraction_numerical': 0.0027100271002710027, 'mean_word_length': 3.5580246913580247, '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': '822832', 'n_tokens_mistral': 612, 'n_tokens_neox': 586, 'n_words': 129}