<commit_before>module Smithy
  class Engine < ::Rails::Engine
    isolate_namespace Smithy
    config.generators do |g|
      g.test_framework :rspec, :view_specs => false
      g.integration_tool :rspec
    end
    config.after_initialize do
      # we need to require all our model files so that ContentBlocks
      # are registered with the engine
      Dir[File.join(File.dirname(__FILE__), '..', '..', 'app', 'models', 'smithy', '*.rb')].each {|file| require file }
    end
  end
end<commit_msg>only load files whose tables exist<commit_after>module Smithy
  class Engine < ::Rails::Engine
    isolate_namespace Smithy
    config.generators do |g|
      g.test_framework :rspec, :view_specs => false
      g.integration_tool :rspec
    end
    config.after_initialize do
      # we need to require all our model files so that ContentBlocks
      # are registered with the engine
      Dir[File.join(File.dirname(__FILE__), '..', '..', 'app', 'models', 'smithy', '*.rb')].each do |file|
        require file if ActiveRecord::Base.connection.table_exists?(file.pluralize)
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.11252268602540835, 'fraction_numerical': 0.0, 'mean_word_length': 3.2099236641221376, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1264189', 'n_tokens_mistral': 334, 'n_tokens_neox': 334, 'n_words': 100}