<commit_before>module IndexPager    

  def index
    controller = self.controller_name.downcase    
    model_name=controller.classify
    model_class=eval(model_name)
    objects = eval("@"+controller)
    objects.size
    @hidden=0
    params[:page] ||= Seek::Config.default_page(controller)

    objects=model_class.paginate_after_fetch(objects, :page=>params[:page],
                                                      :latest_limit => Seek::Config.limit_latest
                                            ) unless objects.respond_to?("page_totals")
    eval("@"+controller+"= objects")

    respond_to do |format|
      format.html
      format.xml
    end

  end

  def find_assets
    controller = self.controller_name.downcase
    model_class=controller.classify.constantize
    if model_class.respond_to? :all_authorized_for
      found = model_class.all_authorized_for "view",User.current_user
    else
      found = model_class.default_order
    end
    found = apply_filters(found)
    
    eval("@" + controller + " = found")
  end
  
end<commit_msg>fix for model which has no default order defined, e.g. scale<commit_after>module IndexPager    

  def index
    controller = self.controller_name.downcase    
    model_name=controller.classify
    model_class=eval(model_name)
    objects = eval("@"+controller)
    objects.size
    @hidden=0
    params[:page] ||= Seek::Config.default_page(controller)

    objects=model_class.paginate_after_fetch(objects, :page=>params[:page],
                                                      :latest_limit => Seek::Config.limit_latest
                                            ) unless objects.respond_to?("page_totals")
    eval("@"+controller+"= objects")

    respond_to do |format|
      format.html
      format.xml
    end

  end

  def find_assets
    controller = self.controller_name.downcase
    model_class=controller.classify.constantize
    if model_class.respond_to? :all_authorized_for
      found = model_class.all_authorized_for "view",User.current_user
    else
      found = model_class.respond_to?(:default_order) ? model_class.default_order : model_class.all
    end
    found = apply_filters(found)
    
    eval("@" + controller + " = found")
  end
  
end
{'fraction_non_alphanumeric': 0.09423849933005807, 'fraction_numerical': 0.0008932559178204555, 'mean_word_length': 2.5725677830940987, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2051553', 'n_tokens_mistral': 643, 'n_tokens_neox': 630, 'n_words': 113}