<commit_before>class Shared::Collection::TablePresenter < Presenter
  def initialize(subject, options = {})
    super(subject, options)
    
    set_default_options(
      {  
        current_parent: parent, show_title: true, append_new_link: true, show_actions: true
      }
    )
  end
  
  def set_options(options)
    @options.merge!(options)
  end
  
  def actions
    return '' unless show_actions
    
    content_tag :td, render('shared/resource/actions', type: type, resource: resource)
  end
  
  def new_link(options = {})
    return '' unless append_new_link
    
    path = if current_parent
      send(
        "new_#{root_model_class_name(current_parent).tableize.singularize}_#{type.gsub('.', '_').singularize}_path(current_parent)", 
        options
      )
    else
      send("new_#{type.gsub('.', '_').singularize}_path", options)
    end
    
    link_to t("#{type}.new.title"), path
  end
end<commit_msg>Complete refactoring of eval to send convertion. refs #54093619<commit_after>class Shared::Collection::TablePresenter < Presenter
  def initialize(subject, options = {})
    super(subject, options)
    
    set_default_options(
      {  
        current_parent: parent, show_title: true, append_new_link: true, show_actions: true
      }
    )
  end
  
  def set_options(options)
    @options.merge!(options)
  end
  
  def actions
    return '' unless show_actions
    
    content_tag :td, render('shared/resource/actions', type: type, resource: resource)
  end
  
  def new_link(options = {})
    return '' unless append_new_link

    path = if current_parent
      send(
        "new_#{root_model_class_name(current_parent).tableize.singularize}_#{type.gsub('.', '_').singularize}_path", 
        current_parent, options
      )
    else
      send("new_#{type.gsub('.', '_').singularize}_path", options)
    end
    
    link_to t("#{type}.new.title"), path
  end
end
{'fraction_non_alphanumeric': 0.11854583772391991, 'fraction_numerical': 0.004214963119072708, 'mean_word_length': 3.119305856832972, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7654165', 'n_tokens_mistral': 605, 'n_tokens_neox': 599, 'n_words': 122}