<commit_before>module CRUD::IndexAction
  extend ActiveSupport::Concern

  included do
    include CRUD::ResourceAssignment
    before_action :assign_resource_for_index, only: :index
    helper_method :collection_instance_json
  end

  def index
    self.collection_instance = collection_instance.index_order if collection_instance.respond_to?(:index_order)
    scope_index_collection
  end

  protected

  def scope_index_collection
    self.collection_instance = default_index_scope
  end

  def default_index_scope
    collection_instance
  end

  def assign_resource_for_index
    self.collection_instance = index_collection
  end

  def collection_instance_json
    render_to_string json: collection_instance
  end

  def index_collection
    collection = base_collection
    collection = collection.search(params[:search]) if resource_class.respond_to?(:search) && params[:search].present?
    collection
  end
end<commit_msg>Ungenutzen Code entfernen<commit_after>module CRUD::IndexAction
  extend ActiveSupport::Concern

  included do
    include CRUD::ResourceAssignment
    before_action :assign_resource_for_index, only: :index
  end

  def index
    self.collection_instance = collection_instance.index_order if collection_instance.respond_to?(:index_order)
    scope_index_collection
  end

  protected

  def scope_index_collection
    self.collection_instance = default_index_scope
  end

  def default_index_scope
    collection_instance
  end

  def assign_resource_for_index
    self.collection_instance = index_collection
  end

  def index_collection
    collection = base_collection
    collection = collection.search(params[:search]) if resource_class.respond_to?(:search) && params[:search].present?
    collection
  end
end
{'fraction_non_alphanumeric': 0.05266170578133944, 'fraction_numerical': 0.0, 'mean_word_length': 4.905405405405405, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1878101', 'n_tokens_mistral': 494, 'n_tokens_neox': 478, 'n_words': 105}