<commit_before>class Permission < ActiveRecord::Base
  audited comment_required: true, associated_with: :role

  belongs_to :role

  validates :role, presence: true

  # "word" in the url-safe base64 alphabet, or single '*'
  SEGMENT = /([\w-]+|\*)/
  private_constant :SEGMENT
  validates :value, presence: true,
                    format: { with: /\A(#{SEGMENT}:)*#{SEGMENT}\z/ }
end<commit_msg>Pin permission audits to provider rather than role<commit_after>class Permission < ActiveRecord::Base
  audited comment_required: true, associated_with: :provider

  belongs_to :role
  delegate :provider, to: :role

  validates :role, presence: true

  # "word" in the url-safe base64 alphabet, or single '*'
  SEGMENT = /([\w-]+|\*)/
  private_constant :SEGMENT
  validates :value, presence: true,
                    format: { with: /\A(#{SEGMENT}:)*#{SEGMENT}\z/ }
end
{'fraction_non_alphanumeric': 0.1380897583429229, 'fraction_numerical': 0.004602991944764097, 'mean_word_length': 3.6774193548387095, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4192751', 'n_tokens_mistral': 293, 'n_tokens_neox': 278, 'n_words': 78}