<commit_before>module HatTrick
  module ModelMethods
    extend ActiveSupport::Concern
    mattr_accessor :current_validation_group

    included do
      alias_method_chain :save, :hat_trick
    end

    def self.set_current_validation_group_for(klass, validation_group_name)
      self.current_validation_group ||= {}
      current_validation_group[klass.to_s.underscore] = validation_group_name
    end

    def self.current_validation_group_for(klass)
      current_validation_group[klass.to_s.underscore]
    end

    def save_with_hat_trick(*args)
      # Rails.logger.info "Saving #{self.inspect} with hat trick"
      enable_validation_group HatTrick::ModelMethods.current_validation_group_for(self.class)<commit_msg>remove commented out log call<commit_after>module HatTrick
  module ModelMethods
    extend ActiveSupport::Concern
    mattr_accessor :current_validation_group

    included do
      alias_method_chain :save, :hat_trick
    end

    def self.set_current_validation_group_for(klass, validation_group_name)
      self.current_validation_group ||= {}
      current_validation_group[klass.to_s.underscore] = validation_group_name
    end

    def self.current_validation_group_for(klass)
      current_validation_group[klass.to_s.underscore]
    end

    def save_with_hat_trick(*args)
      enable_validation_group HatTrick::ModelMethods.current_validation_group_for(self.class)
{'fraction_non_alphanumeric': 0.06357142857142857, 'fraction_numerical': 0.0, 'mean_word_length': 4.718367346938775, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1439967', 'n_tokens_mistral': 433, 'n_tokens_neox': 424, 'n_words': 67}