<commit_before>module Chassis
  module Persistance
    module ClassMethods
      def create(*args, &block)
        record = new(*args, &block)
        record.save
        record
      end

      def repo
        @repo ||= "#{name}Repo".constantize
      end
    end

    class << self
      def included(base)
        base.class_eval do
          attr_accessor :id
        end

        base.extend ClassMethods
      end
    end

    def save
      repo.save self
    end

    def delete
      repo.delete self
    end

    def new_record?
      id.nil?
    end

    def ==(o)
      if o.instance_of? self.class
        o && o.id == id
      else
        false
      end
    end

    def eql?(o)
      self == o
    end

    def hash
      id
    end

    def repo
      self.class.repo
    end

    def inspect
      "<#{self.class.name}:#{id}>"
    end
  end
end<commit_msg>Use equalizer<commit_after>module Chassis
  module Persistance
    module ClassMethods
      def create(*args, &block)
        record = new(*args, &block)
        record.save
        record
      end

      def repo
        @repo ||= "#{name}Repo".constantize
      end
    end

    class << self
      def included(base)
        base.class_eval do
          include Equalizer.new(:id)
          attr_accessor :id
        end

        base.extend ClassMethods
      end
    end

    def save
      repo.save self
    end

    def delete
      repo.delete self
    end

    def new_record?
      id.nil?
    end

    def repo
      self.class.repo
    end
  end
end
{'fraction_non_alphanumeric': 0.07272727272727272, 'fraction_numerical': 0.0, 'mean_word_length': 1.4229559748427674, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 4, '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': '7119087', 'n_tokens_mistral': 485, 'n_tokens_neox': 469, 'n_words': 135}