<commit_before>class Hq::OrphansController < HqController

  ADDRESS_DETAILS = [:id, :city, :province_id, :street, :neighborhood, :details]

  def index
    redirect_to(hq_orphans_path) and return if params["commit"]=="Clear Filters"

    @current_sort_column = valid_sort_column
    @current_sort_direction = valid_sort_direction

    @filters = filters_params
    @orphans = Orphan
      .filter(@filters)
      .includes(valid_sort_columns_included_resource)
      .order(@current_sort_column.to_s + " " +  @current_sort_direction.to_s)
      .paginate(:page => params[:page])

    load_scope

    respond_to do |format|
      format.html
      format.csv { send_data Orphan.to_csv(Orphan.all), filename: "orphans-#{Date.today}.csv" }
    end
  end

  def show
    load_orphan
    @sponsor = @orphan.current_sponsor
  end

  def edit<commit_msg>Add filtered, but not paginated, full orphans list to the csv format response<commit_after>class Hq::OrphansController < HqController

  ADDRESS_DETAILS = [:id, :city, :province_id, :street, :neighborhood, :details]

  def index
    redirect_to(hq_orphans_path) and return if params["commit"]=="Clear Filters"

    @current_sort_column = valid_sort_column
    @current_sort_direction = valid_sort_direction

    @filters = filters_params
    @orphans_before_paginate = Orphan
      .filter(@filters)
      .includes(valid_sort_columns_included_resource)
      .order(@current_sort_column.to_s + " " +  @current_sort_direction.to_s)
    @orphans = @orphans_before_paginate.paginate(:page => params[:page])

    load_scope

    respond_to do |format|
      format.html
      format.csv { send_data Orphan.to_csv(@orphans_before_paginate), filename: "orphans-#{Date.today}.csv" }
    end
  end

  def show
    load_orphan
    @sponsor = @orphan.current_sponsor
  end

  def edit
{'fraction_non_alphanumeric': 0.10038398244651674, 'fraction_numerical': 0.0, 'mean_word_length': 4.010989010989011, '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': '4028492', 'n_tokens_mistral': 633, 'n_tokens_neox': 601, 'n_words': 116}