<commit_before>module Tenacity
  class Association
    attr_reader :association_id, :class_name

    def initialize(association_id, options={})
      @association_id = association_id

      if options[:class_name]
        @class_name = options[:class_name]
      else
        @class_name = association_id.to_s.singularize.camelcase
      end
    end

    def associate_class
      @clazz ||= Kernel.const_get(@class_name)
    end
  end
end<commit_msg>Add method to fetch the foreign key for an association<commit_after>module Tenacity
  class Association
    attr_reader :association_id, :class_name

    def initialize(association_id, options={})
      @association_id = association_id

      if options[:class_name]
        @class_name = options[:class_name]
      else
        @class_name = association_id.to_s.singularize.camelcase
      end
    end

    def associate_class
      @clazz ||= Kernel.const_get(@class_name)
    end

    def foreign_key
      @class_name.underscore + "_id"
    end
  end
end
{'fraction_non_alphanumeric': 0.07433102081268583, 'fraction_numerical': 0.0, 'mean_word_length': 3.0725806451612905, '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': '4092542', 'n_tokens_mistral': 318, 'n_tokens_neox': 307, 'n_words': 69}