<commit_before>class EventPresenter

  class UpdateRepositoryEvent < self

    def action
      action_for_event(:event_updated_repository) {
        link_to(
          h(target.url_path),
          view.project_repository_path(target.project, event)
        )
      }
    end

    def category
      'repository'
    end

  end

end
<commit_msg>Workaround case where update repo event points to deleted repo<commit_after>class EventPresenter

  class UpdateRepositoryEvent < self

    def action
      action_for_event(:event_updated_repository) {
        if repository
          link_to(
            h(repository.url_path),
            view.project_repository_path(project, repository)
          )
        else
          'repository was deleted'
        end
      }
    end

    def category
      'repository'
    end

    def repository
      target
    end

  end

end

{'fraction_non_alphanumeric': 0.05148741418764302, 'fraction_numerical': 0.0, 'mean_word_length': 2.048780487804878, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4261284', 'n_tokens_mistral': 243, 'n_tokens_neox': 236, 'n_words': 58}