<commit_before>module DataMapper
  module Types
    class Discriminator < DataMapper::Type
      primitive Class
      track :set
      default lambda { |r,p| p.model }
 
      def self.bind(property)
        model = property.model

        model.class_eval <<-EOS
          def self.child_classes
            @child_classes ||= []
          end

          after_class_method :inherited, :add_scope_for_discriminator
          
          def self.add_scope_for_discriminator(target)
            #target.send(:scope_stack) << DataMapper::Query.new(target.repository, target, :#{property.name} => target.child_classes << target)<commit_msg>fixed it fo realz (commented out a line in last commit)<commit_after>module DataMapper
  module Types
    class Discriminator < DataMapper::Type
      primitive Class
      track :set
      default lambda { |r,p| p.model }
 
      def self.bind(property)
        model = property.model

        model.class_eval <<-EOS
          def self.child_classes
            @child_classes ||= []
          end

          after_class_method :inherited, :add_scope_for_discriminator
          
          def self.add_scope_for_discriminator(target)
            target.send(:scope_stack) << DataMapper::Query.new(target.repository, target, :#{property.name} => target.child_classes << target)
{'fraction_non_alphanumeric': 0.09187547456340167, 'fraction_numerical': 0.0, 'mean_word_length': 2.5335120643431637, 'pattern_counts': {'":': 0, '<': 17, '<?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': '3084832', 'n_tokens_mistral': 374, 'n_tokens_neox': 367, 'n_words': 81}