<commit_before>module MongoMapper
  module Associations
    # Base class for keeping track of associations.
    #
    # @private
    class Base
      attr_reader :type, :name, :options, :finder_options

      # Options that should not be considered MongoDB query options/criteria
      AssociationOptions = [:as, :class, :class_name, :dependent, :extend, :foreign_key, :polymorphic]

      def initialize(type, name, options={}, &extension)
        @type, @name, @options, @finder_options = type, name, {}, {}
        options.symbolize_keys!

        options[:extend] = modulized_extensions(extension, options[:extend])

        options.each_pair do |key, value|
          if AssociationOptions.include?(key)
            @options[key] = value
          else
            @finder_options[key] = value
          end
        end
      end

      def class_name
        @class_name ||= begin
          if cn = options[:class_name]
            cn
          elsif many?
            name.to_s.singularize.camelize
          else
            name.to_s.camelize
          end
        end
      end

      def klass
        @klass ||= options[:class] ? options[:class] : class_name.constantize
      end

      def many?
        @many_type ||= @type == :many
      end<commit_msg>Switched to || from ternary.<commit_after>module MongoMapper
  module Associations
    # Base class for keeping track of associations.
    #
    # @private
    class Base
      attr_reader :type, :name, :options, :finder_options

      # Options that should not be considered MongoDB query options/criteria
      AssociationOptions = [:as, :class, :class_name, :dependent, :extend, :foreign_key, :polymorphic]

      def initialize(type, name, options={}, &extension)
        @type, @name, @options, @finder_options = type, name, {}, {}
        options.symbolize_keys!

        options[:extend] = modulized_extensions(extension, options[:extend])

        options.each_pair do |key, value|
          if AssociationOptions.include?(key)
            @options[key] = value
          else
            @finder_options[key] = value
          end
        end
      end

      def class_name
        @class_name ||= begin
          if cn = options[:class_name]
            cn
          elsif many?
            name.to_s.singularize.camelize
          else
            name.to_s.camelize
          end
        end
      end

      def klass
        @klass ||= options[:class] || class_name.constantize
      end

      def many?
        @many_type ||= @type == :many
      end
{'fraction_non_alphanumeric': 0.09542586750788644, 'fraction_numerical': 0.0, 'mean_word_length': 2.0419664268585134, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5920881', 'n_tokens_mistral': 727, 'n_tokens_neox': 703, 'n_words': 189}