<commit_before>class Manifest < ApplicationRecord
  belongs_to :repository
  has_many :repository_dependencies, dependent: :delete_all

  scope :latest, -> { order("manifests.filepath, manifests.created_at DESC").select("DISTINCT on (manifests.filepath) *") }
  scope :platform, ->(platform) { where('lower(manifests.platform) = ?', platform.try(:downcase)) }
  scope :kind, ->(kind) { where(kind: kind) }

  def repository_link
    repository.blob_url(sha || branch) + filepath
  end
end
<commit_msg>Fix links to manifests on repository hosts<commit_after>class Manifest < ApplicationRecord
  belongs_to :repository
  has_many :repository_dependencies, dependent: :delete_all

  scope :latest, -> { order("manifests.filepath, manifests.created_at DESC").select("DISTINCT on (manifests.filepath) *") }
  scope :platform, ->(platform) { where('lower(manifests.platform) = ?', platform.try(:downcase)) }
  scope :kind, ->(kind) { where(kind: kind) }

  def repository_link
    repository.blob_url(branch) + filepath
  end
end

{'fraction_non_alphanumeric': 0.134765625, 'fraction_numerical': 0.0, 'mean_word_length': 5.528662420382165, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '3061972', 'n_tokens_mistral': 328, 'n_tokens_neox': 312, 'n_words': 71}