<commit_before>class ActivityReport < Report

  def csv_string
    # This is replacing the generate method
  end

  private

  def data
    Activity.includes(:location, :judge).between_dates(start_date, end_date)
  end
end<commit_msg>green lit spec for csv_string method<commit_after># frozen_string_literal: true
class ActivityReport < Report

  def csv_string
    column_headers = ['Event', 'Date', 'Location Name', 'Judge', 'No. of Accompaniments']

    CSV.generate(headers: true) do |csv|
      csv << column_headers

      data.each do |activity|
        row = []
        row << activity.event
        row << activity.occur_at.to_s
        row << activity.location.name
        row << activity.judge.name
        row << activity.accompaniments.count.to_s
        csv << row
      end
    end
  end
 

  private

  def data
    Activity.includes(:location, :judge).between_dates(start_date, end_date)
  end
end
{'fraction_non_alphanumeric': 0.09289617486338798, 'fraction_numerical': 0.0, 'mean_word_length': 2.9482758620689653, 'pattern_counts': {'":': 0, '<': 19, '<?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': '6411644', 'n_tokens_mistral': 289, 'n_tokens_neox': 268, 'n_words': 74}