<commit_before>class AssignmentFile < ActiveRecord::Base

  belongs_to :assignment

  validates_presence_of :filename
  validates_uniqueness_of :filename, scope: :assignment_id
  validates_format_of :filename,
          with: /^[0-9a-zA-Z\.\-_]+$/,
          message: I18n.t('validation_messages.format_of_assignment_file')

end
<commit_msg>Fix security warning from Rails 4 related to regepx anchors<commit_after>class AssignmentFile < ActiveRecord::Base

  belongs_to :assignment

  validates_presence_of :filename
  validates_uniqueness_of :filename, scope: :assignment_id
  validates_format_of :filename,
          with: /\A[0-9a-zA-Z\.\-_]+\z/,
          message: I18n.t('validation_messages.format_of_assignment_file')

end

{'fraction_non_alphanumeric': 0.10136986301369863, 'fraction_numerical': 0.012328767123287671, 'mean_word_length': 4.455223880597015, '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': '4305947', 'n_tokens_mistral': 257, 'n_tokens_neox': 245, 'n_words': 45}