<commit_before>require "rails_sanitize"

module XssTerminate
  def self.included(base)
    base.extend(ClassMethods)
    # sets up default of stripping tags for all fields
    # base.send(:xss_terminate)
  end

  module ClassMethods
    def xss_terminate(options = {})
      before_validation :sanitize_fields

      class_attribute :xss_terminate_options
      self.xss_terminate_options = {
        :except => (options[:except] || []),
        :sanitize => (options[:sanitize] || [])
      }
<commit_msg>Enable by default<commit_after>require "rails_sanitize"

module XssTerminate
  def self.included(base)
    base.extend(ClassMethods)
    # sets up default of stripping tags for all fields
    base.send(:xss_terminate)
  end

  module ClassMethods
    def xss_terminate(options = {})
      before_validation :sanitize_fields

      class_attribute :xss_terminate_options
      self.xss_terminate_options = {
        :except => (options[:except] || []),
        :sanitize => (options[:sanitize] || [])
      }

{'fraction_non_alphanumeric': 0.10355029585798817, 'fraction_numerical': 0.0, 'mean_word_length': 3.4517543859649122, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5483394', 'n_tokens_mistral': 318, 'n_tokens_neox': 317, 'n_words': 64}