<commit_before>class Record
  attr_accessor :created_at, :meeting_date, :club_name, :leaders, :attendance,
    :notes

  def initialize(created_at, meeting_date, club_name, leaders, attendance,
                 notes)
    @created_at = created_at
    @meeting_date = meeting_date
    @club_name = club_name
    @leaders = leaders
    @attendance = attendance
    @notes = notes
  end

  # The titles of the fields that are getting put in the CSV.
  # This should be generated at runtime.
  def self.csv_title
    ['created_at', 'meeting_date', 'club_name', 'leaders', 'attendance',
     'notes']
  end

  def csv_contents
    [created_at, meeting_date, club_name, leaders, attendance, notes]
  end
end

namespace :export do 
  desc 'Generate a report of all check ins'
  task :check_ins => :environment do
    csv_string = CSV.generate do |csv|
      csv << Record.csv_title
      ::CheckIn.all.each do |check_in|
        r = Record.new(
          check_in.created_at,
          check_in.meeting_date,
          check_in.club.name,
          check_in.club.leaders.all.map { |l| l.name }.uniq,
          check_in.attendance,
          check_in.notes
        )

        csv << r.csv_contents
      end
    end

    puts csv_string
  end
end<commit_msg>Fix Rubocop<commit_after>class Record
  attr_accessor :created_at, :meeting_date, :club_name, :leaders, :attendance,
                :notes

  def initialize(created_at, meeting_date, club_name, leaders, attendance,
                 notes)
    @created_at = created_at
    @meeting_date = meeting_date
    @club_name = club_name
    @leaders = leaders
    @attendance = attendance
    @notes = notes
  end

  # The titles of the fields that are getting put in the CSV.
  # This should be generated at runtime.
  def self.csv_title
    %w(created_at meeting_date club_name leaders attendance notes)
  end

  def csv_contents
    [created_at, meeting_date, club_name, leaders, attendance, notes]
  end
end

namespace :export do
  desc 'Generate a report of all check ins'
  task check_ins: :environment do
    csv_string = CSV.generate do |csv|
      csv << Record.csv_title
      ::CheckIn.all.each do |check_in|
        r = Record.new(
          check_in.created_at,
          check_in.meeting_date,
          check_in.club.name,
          check_in.club.leaders.all.map(&:name).uniq,
          check_in.attendance,
          check_in.notes
        )

        csv << r.csv_contents
      end
    end

    puts csv_string
  end
end
{'fraction_non_alphanumeric': 0.0826946349334409, 'fraction_numerical': 0.0, 'mean_word_length': 2.5632183908045976, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 4, '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': '196940', 'n_tokens_mistral': 809, 'n_tokens_neox': 791, 'n_words': 215}