<commit_before>require 'rails/all'
require 'active_record_batteries'

ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => ':memory:')
ActiveRecord::Schema.verbose = false

ActiveRecord::Schema.define do
  self.verbose = false

  create_table :author do |t|
    t.string :name

    t.timestamps null: false
  end

  create_table :articles do |t|
    t.string :title
    t.text   :body
    t.references :author

    # Sluggable
    t.string :slug

    # Deletable
    t.datetime :deleted_at

    t.timestamps null: false
  end
end

class Author < ActiveRecord::Base
  batteries! :sluggable, :paginable, :filterable, :relationship_scopes

  has_many :articles
end

class Article < ActiveRecord::Base
  batteries! :sluggable, :paginable, :filterable, :relationship_scopes, :deletable

  belongs_to :author
end<commit_msg>Library defaults for the test models.<commit_after>require 'rails/all'
require 'active_record_batteries'

ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => ':memory:')
ActiveRecord::Schema.verbose = false

ActiveRecord::Schema.define do
  self.verbose = false

  create_table :authors do |t|
    t.string :name

    # Sluggable
    t.string :slug

    t.timestamps null: false
  end

  create_table :articles do |t|
    t.string :title
    t.text   :body
    t.references :author

    # Sluggable
    t.string :slug

    # Deletable
    t.datetime :deleted_at

    t.timestamps null: false
  end
end

class Author < ActiveRecord::Base
  batteries! :sluggable, :paginable, :filterable, :relationship_scopes

  has_many :articles

  filter_add :by_slug
end

class Article < ActiveRecord::Base
  batteries! :sluggable, :paginable, :filterable, :relationship_scopes, :deletable

  belongs_to :author

  slug_base_column :title

  filter_add :by_slug
  filter_add :by_title, ->(title) { where(title: title) }

  page_items 5
end
{'fraction_non_alphanumeric': 0.09947089947089947, 'fraction_numerical': 0.0015873015873015873, 'mean_word_length': 4.097035040431267, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, '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': '2182382', 'n_tokens_mistral': 652, 'n_tokens_neox': 631, 'n_words': 156}