<commit_before>class Signature < ActiveRecord::Base
  include SignatureConcerns
  # -- associations
  has_many :events, foreign_key: :alert_signature_id

  # -- configuration
  ACTIONS = ['drop', 'ignore', 'normal', 'alert']
  # -- validations and callbacks
  validates :signature_id, presence: true, uniqueness: true
  validates :signature_info, presence: true
  validates :action, :allow_blank => false,
            :inclusion => {
              in: Signature::ACTIONS,
              message: "Select one of #{Signature::ACTIONS.join(", ")}"
            }


end
<commit_msg>use correct primary key for signature.events<commit_after>class Signature < ActiveRecord::Base
  include SignatureConcerns
  # -- associations
  has_many :events, foreign_key: :alert_signature_id, primary_key: :signature_id

  # -- configuration
  ACTIONS = ['drop', 'ignore', 'normal', 'alert']
  # -- validations and callbacks
  validates :signature_id, presence: true, uniqueness: true
  validates :signature_info, presence: true
  validates :action, :allow_blank => false,
            :inclusion => {
              in: Signature::ACTIONS,
              message: "Select one of #{Signature::ACTIONS.join(", ")}"
            }


end

{'fraction_non_alphanumeric': 0.11890999174236168, 'fraction_numerical': 0.0, 'mean_word_length': 3.3440860215053765, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '4975060', 'n_tokens_mistral': 351, 'n_tokens_neox': 338, 'n_words': 91}