<commit_before>class GenerateActivitiesJob
  class << self
    def perform
      objects_needing_processing.each do |o|
        o.generate_activities!
      end
    end

    def reset!
      # This really doesn't belong here...
      SqlUtil.execute <<-END
        TRUNCATE positions RESTART IDENTITY CASCADE;
        DELETE FROM activity_adjustments;
      END
    end

    def classes_needing_processing
      RailsUtil.all(:models).select{|m| m.method_defined?(:generate_activities!)}
    end

    def objects_needing_processing<commit_msg>Fixed GenerateActivitiesJob.reset!<commit_after>class GenerateActivitiesJob
  class << self
    def perform
      objects_needing_processing.each do |o|
        o.generate_activities!
      end
    end

    def reset!
      # This really doesn't belong here...
      SqlUtil.execute <<-END
        TRUNCATE positions RESTART IDENTITY CASCADE;
        UPDATE investment_splits SET activity_adjustment_id=NULL;
        DELETE FROM activity_adjustments;
        ALTER SEQUENCE activity_adjustments_id_seq RESTART;
      END
    end

    def classes_needing_processing
      RailsUtil.all(:models).select{|m| m.method_defined?(:generate_activities!)}
    end

    def objects_needing_processing
{'fraction_non_alphanumeric': 0.0640713706407137, 'fraction_numerical': 0.0, 'mean_word_length': 2.967845659163987, 'pattern_counts': {'":': 0, '<': 11, '<?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': '6796645', 'n_tokens_mistral': 368, 'n_tokens_neox': 348, 'n_words': 84}