<commit_before>require 'rubygems'
gem 'activerecord'
require 'active_record'
require "stringex"
# Reload adapters to make sure ActsAsUrl sees the ORM
Stringex::ActsAsUrl::Adapter.load_available

puts "-------------------------------------------------"
puts "Running ActsAsUrl tests with ActiveRecord adapter"
puts "-------------------------------------------------"

ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => "acts_as_url.sqlite3")

ActiveRecord::Migration.verbose = false
ActiveRecord::Schema.define do
  create_table :documents, :force => true do |t|
    t.string :title, :other, :url
  end

  create_table :sti_base_documents, :force => true do |t|
    t.string :title, :other, :url, :type
  end
end
ActiveRecord::Migration.verbose = true

class Document < ActiveRecord::Base
  acts_as_url :title
end

class STIBaseDocument < ActiveRecord::Base
  # This gets redefined in the only test that uses it but I want to be uniform
  # in setting configuration details in the tests themselves
  acts_as_url :title
end

class STIChildDocument < STIBaseDocument
end
<commit_msg>use in memory sqlite db for active record<commit_after>require 'rubygems'
gem 'activerecord'
require 'active_record'
require "stringex"
# Reload adapters to make sure ActsAsUrl sees the ORM
Stringex::ActsAsUrl::Adapter.load_available

puts "-------------------------------------------------"
puts "Running ActsAsUrl tests with ActiveRecord adapter"
puts "-------------------------------------------------"

ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")

ActiveRecord::Migration.verbose = false
ActiveRecord::Schema.define do
  create_table :documents, :force => true do |t|
    t.string :title, :other, :url
  end

  create_table :sti_base_documents, :force => true do |t|
    t.string :title, :other, :url, :type
  end
end
ActiveRecord::Migration.verbose = true

class Document < ActiveRecord::Base
  acts_as_url :title
end

class STIBaseDocument < ActiveRecord::Base
  # This gets redefined in the only test that uses it but I want to be uniform
  # in setting configuration details in the tests themselves
  acts_as_url :title
end

class STIChildDocument < STIBaseDocument
end

{'fraction_non_alphanumeric': 0.1692860350246969, 'fraction_numerical': 0.001347103726986978, 'mean_word_length': 3.360078277886497, 'pattern_counts': {'":': 1, '<': 9, '<?xml version=': 0, '>': 11, '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': '1678203', 'n_tokens_mistral': 640, 'n_tokens_neox': 621, 'n_words': 209}