<commit_before>require 'spec_helper'
require 'active_record'
require 'bundler/psyched_yaml'
require 'shoulda/matchers'
connection_info = YAML.load_file("config/database.yml")["test"]
# ActiveRecord::Base.establish_connection(connection_info)

# RSpec.configure do |config|
#   config.around do |example|
#     ActiveRecord::Base.transaction do
#       example.run
#       raise ActiveRecord::Rollback
#     end
#   end
# end
<commit_msg>only connect for model specs if no existing connection<commit_after>require 'spec_helper'
require 'active_record'
require 'bundler/psyched_yaml'
require 'shoulda/matchers'
connection_info = YAML.load_file("config/database.yml")["test"]

unless ActiveRecord::Base.connected?
  ActiveRecord::Base.establish_connection(connection_info)

  RSpec.configure do |config|
    config.around do |example|
      ActiveRecord::Base.transaction do
        example.run
        raise ActiveRecord::Rollback
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.10146443514644352, 'fraction_numerical': 0.0, 'mean_word_length': 4.907407407407407, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5292913', 'n_tokens_mistral': 292, 'n_tokens_neox': 282, 'n_words': 61}