<commit_before># frozen_string_literal: true
module AuditTables
  class CreateAuditTablesForExistingTables < Base
    attr_reader :klasses

    def initialize
      @klasses = ActiveRecord::Base.connection.tables
      @klasses -= Module::BLACK_LISTED_TABLES
    end

    def process
      klasses.each do |klass|
        AuditTables::BuildAuditTrigger.new(klass).build
        @table_name = klass
        @klass = klass.classify.safe_constantize
        @audit_table_name = "audit_#{klass}"
        sync_audit_tables
      end
    end
  end
end<commit_msg>CreateAuditTablesForExistingTables instantiates instances of CreateNewAuditTable for each iteration through the loop<commit_after># frozen_string_literal: true
module AuditTables
  class CreateAuditTablesForExistingTables
    attr_reader :klasses

    def initialize
      @klasses = ActiveRecord::Base.connection.tables
      @klasses -= Module::BLACK_LISTED_TABLES
    end

    def process
      klasses.each do |klass|
        AuditTables::BuildAuditTrigger.new(klass).build
        AuditTables::CreateNewAuditTable.new(klass).build
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.06428571428571428, 'fraction_numerical': 0.0, 'mean_word_length': 3.484, 'pattern_counts': {'":': 0, '<': 4, '<?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': '6880035', 'n_tokens_mistral': 330, 'n_tokens_neox': 334, 'n_words': 70}