<commit_before>module ActiveRecord
  # Public: Add entity method to ActiveRecord::Relation class
  #
  # Examples
  #
  #   User.all.entity
  #   # => #<User::Entity:0x007fb4610d8a00
  #        @object=#<ActiveRecord::Relation [...]>, @options={}>
  class Relation
    define_method(Greenin.entity_method_name) do
      begin
        entity = %(#{model}::#{Greenin.entity_class_name}).constantize
      rescue NameError
        entity = nil
      end
      entity.new(self) if entity
    end
  end

  # Public: Add entity methods to ActiveRecord::Base class
  #
  # Examples
  #
  #   User.entity
  #   # => User::Entity
  #
  #   User.new.entity
  #   # => #<User::Entity:0x007fb462263090 @object=
  #        #<User id: nil, ..., created_at: nil, updated_at: nil>, @options={}>
  class Base
    define_singleton_method Greenin.entity_method_name do
      begin
        entity = %(#{self}::#{Greenin.entity_class_name}).constantize
      rescue NameError
        entity = nil
      end
      entity
    end

    define_method(Greenin.entity_method_name) do
      begin
        entity = %(#{self.class}::#{Greenin.entity_class_name})
                 .constantize<commit_msg>spec fails revert for hotfix to master<commit_after>module ActiveRecord
  # Public: Add entity method to ActiveRecord::Relation class
  #
  # Examples
  #
  #   User.all.entity
  #   # => #<User::Entity:0x007fb4610d8a00
  #        @object=#<ActiveRecord::Relation [...]>, @options={}>
  class Relation
    define_method(Greenin.entity_method_name) do
      begin
        entity = %(#{model}::#{Greenin.entity_class_name}).constantize
      rescue NameError
        entity = nil
      end
      entity.new(self) if entity
    end
  end

  # Public: Add entity methods to ActiveRecord::Base class
  #
  # Examples
  #
  #   User.entity
  #   # => User::Entity
  #
  #   User.new.entity
  #   # => #<User::Entity:0x007fb462263090 @object=
  #        #<User id: nil, ..., created_at: nil, updated_at: nil>, @options={}>
  class Base
    define_singleton_method Greenin.entity_method_name do
      begin
        entity = %(#{self}::#{Greenin.entity_class_name}).constantize
      rescue NameError
        entity = nil
      end
      entity.new(self) if entity
    end

    define_method(Greenin.entity_method_name) do
      begin
        entity = %(#{self.class}::#{Greenin.entity_class_name})
                 .constantize
{'fraction_non_alphanumeric': 0.12244045131633932, 'fraction_numerical': 0.020058503969912243, 'mean_word_length': 2.649390243902439, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, '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': '7295419', 'n_tokens_mistral': 798, 'n_tokens_neox': 774, 'n_words': 153}