<commit_before>class Tag < ActiveRecord::Base
  has_many :taggings
  default_scope :order => 'name ASC'
  
  validates_presence_of :name
  before_save :sanitize_name
  
  def self.sanitize_name(name)
    name.strip.squeeze(' ').downcase
  end
  
  def to_s
    self.name
  end

  private
  
  def sanitize_name
    self.name = self.class.sanitize_name(self.name)
  end<commit_msg>Call to_s first so we can pass tags to tagged_with_any.<commit_after>class Tag < ActiveRecord::Base
  has_many :taggings
  default_scope :order => 'name ASC'
  
  validates_presence_of :name
  before_save :sanitize_name
  
  def self.sanitize_name(name)
    name.to_s.strip.squeeze(' ').downcase
  end
  
  def to_s
    self.name
  end

  private
  
  def sanitize_name
    self.name = self.class.sanitize_name(self.name)
  end
{'fraction_non_alphanumeric': 0.08178438661710037, 'fraction_numerical': 0.0, 'mean_word_length': 3.391304347826087, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5495923', 'n_tokens_mistral': 305, 'n_tokens_neox': 305, 'n_words': 64}