<commit_before># encoding: utf-8

require 'active_type/version'


load_now = proc do
  require 'active_type/util'
  require 'active_type/record'
  require 'active_type/object'

  if ActiveRecord::VERSION::STRING == '4.2.0'
    raise(<<-MESSAGE.strip_heredoc)
      ActiveType is not compatible with ActiveRecord 4.2.0. Please upgrade to 4.2.1
      For details see https://github.com/makandra/active_type/issues/31
    MESSAGE
  end
end


if defined?(Rails) && defined?(ActiveSupport)
  # If we are inside Rails, we'll assume active_record will be required anyways
  # in this case, wait until then, to not mess with ActiveRecord configuration.
  # (compare https://github.com/rails/rails/issues/23589)
  ActiveSupport.on_load(:active_record) do
    load_now.call()
  end
else
  # No Rails.
  require 'active_record'
  load_now.call()
end<commit_msg>autoload ActiveType::Object / ::Record [fixes #75]<commit_after># encoding: utf-8

require 'active_type/version'

require 'active_record'

if ActiveRecord::VERSION::STRING == '4.2.0'
  raise(<<-MESSAGE.strip_heredoc)
    ActiveType is not compatible with ActiveRecord 4.2.0. Please upgrade to 4.2.1
    For details see https://github.com/makandra/active_type/issues/31
  MESSAGE
end

module ActiveType
  extend ActiveSupport::Autoload

  autoload :Object
  autoload :Record
  autoload :Util
end
{'fraction_non_alphanumeric': 0.10491071428571429, 'fraction_numerical': 0.023065476190476192, 'mean_word_length': 4.173076923076923, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 3, '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': '3903572', 'n_tokens_mistral': 460, 'n_tokens_neox': 434, 'n_words': 118}