<commit_before>require_dependency 'version'
module VersionPatch
  def self.included(base)
    base.send(:extend,ClassMethods)
    base.send(:include, InstanceMethods)
    base.class_eval do
      unloadable
      has_many :iteration_histories,:dependent=>:delete_all
      after_save :create_history
      attr_accessor :change_reason
    end
  end

  module ClassMethods
  end

  module InstanceMethods
    def create_history
      if self.changed? && self.changes['effective_date']
        logger.info "*********************************************************************************************************"
        tmp = self.inspect
        logger.info tmp
        logger.info "############################################################################################################"
        self.iteration_histories.create!(:old_due_date=>self.changes['effective_date'][0],
                                         :new_due_date=>self.effective_date,
                                         :reason=>self.change_reason)
      end
    end
  end<commit_msg> change after_save to after_update<commit_after>require_dependency 'version'
module VersionPatch
  def self.included(base)
    base.send(:extend,ClassMethods)
    base.send(:include, InstanceMethods)
    base.class_eval do
      unloadable
      has_many :iteration_histories,:dependent=>:delete_all
      after_update :create_history
      attr_accessor :change_reason
    end
  end

  module ClassMethods
  end

  module InstanceMethods
    def create_history
      if self.changed? && self.changes['effective_date']
        logger.info "*********************************************************************************************************"
        tmp = self.inspect
        logger.info tmp
        logger.info "############################################################################################################"
        self.iteration_histories.create!(:old_due_date=>self.changes['effective_date'][0],
                                         :new_due_date=>self.effective_date,
                                         :reason=>self.change_reason)
      end
    end
  end
{'fraction_non_alphanumeric': 0.2624014835419564, 'fraction_numerical': 0.0009272137227630969, 'mean_word_length': 3.1740812379110253, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4471382', 'n_tokens_mistral': 508, 'n_tokens_neox': 491, 'n_words': 87}