<commit_before>module SuperModel
  module Redis
    module ClassMethods
      def redis
        @redis ||= ::Redis.new
      end
      
      def indexes(*indexes)
        @indexes ||= []
        @indexes += indexes.map(&:to_s)
      end
      
      def serialize(*attributes)
        @serialize ||= []
        @serialize += attributes.map(&:to_s)
      end      
      
      def redis_key(*args)
        args.unshift(self.name.downcase)
        args.join(":")
      end
      
      def find(id)
        if redis.set_member?(redis_key, id)
          existing(:id => id)
        else
          raise(UnknownRecord)
        end
      end
      
      def first
        all.first
      end
      
      def last
        all.last
      end
      <commit_msg>copy indexes and serialized columns to inherited children<commit_after>module SuperModel
  module Redis
    module ClassMethods
      def redis
        @redis ||= ::Redis.new
      end
      
      def indexes(*indexes)
        @indexes ||= []
        @indexes += indexes.map(&:to_s)
      end
      
      def indexes=(indexes)
        @indexes = indexes
      end
      
      def serialize(*attributes)
        @serialize ||= []
        @serialize += attributes.map(&:to_s)
      end
      
      def serialize=(attributes)
        @serialize = attributes
      end
      
      def inherited(child) #:nodoc:
        super(child)
        child.indexes   = indexes
        child.serialize = serialize
      end   
      
      def redis_key(*args)
        args.unshift(self.name.downcase)
        args.join(":")
      end
      
      def find(id)
        if redis.set_member?(redis_key, id)
          existing(:id => id)
        else
          raise(UnknownRecord)
        end
      end
      
      def first
        all.first
      end
      
      def last
        all.last
      end
      
{'fraction_non_alphanumeric': 0.09120345385860766, 'fraction_numerical': 0.0, 'mean_word_length': 1.37997432605905, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 5, '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': '6924230', 'n_tokens_mistral': 553, 'n_tokens_neox': 546, 'n_words': 120}