<commit_before>class Notify
  def self.everyone(submission, from, about)
    (submission.participants - [from]).each do |to|
      new(submission, to, from, about).save
    end
  end

  def self.source(submission, from, about)
    new(submission, to, from, about).save
  end

  attr_reader :submission, :to, :from, :about

  def initialize(submission, to, from, about)
    @submission = submission
    @to = to
    @from = from
    @about = about
  end

  def save
    Notification.create({
      user: to,
      from: from.username,
      regarding: about,
      link: send("#{about}_link".to_sym)
    })
  end

  def approval_link
    [
      submission.user.username,
      submission.language,
      submission.slug
    ].join("/")
  end

  def nitpick_link
    [
      "submissions",
      submission.id
    ].join("/")
  end
  alias_method :comment_link, :nitpick_link

end<commit_msg>Prepend `/` to notification links.<commit_after>class Notify
  def self.everyone(submission, from, about)
    (submission.participants - [from]).each do |to|
      new(submission, to, from, about).save
    end
  end

  def self.source(submission, from, about)
    new(submission, to, from, about).save
  end

  attr_reader :submission, :to, :from, :about

  def initialize(submission, to, from, about)
    @submission = submission
    @to = to
    @from = from
    @about = about
  end

  def save
    Notification.create({
      user: to,
      from: from.username,
      regarding: about,
      link: link(about)
    })
  end

  def link(about)
    "/" + send("#{about}_link".to_sym)
  end
  def approval_link
    [
      submission.user.username,
      submission.language,
      submission.slug
    ].join("/")
  end

  def nitpick_link
    [
      "submissions",
      submission.id
    ].join("/")
  end
  alias_method :comment_link, :nitpick_link

end
{'fraction_non_alphanumeric': 0.11898323418063818, 'fraction_numerical': 0.0, 'mean_word_length': 2.5992217898832686, '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': '7298162', 'n_tokens_mistral': 623, 'n_tokens_neox': 616, 'n_words': 152}