<commit_before>module EventOngoingValidation
  extend ActiveSupport::Concern

  included do
    validate :event_ongoing_validation

    before_destroy :event_ongoing_validation
  end

  def event_ongoing_validation
    return true unless event && event.finished?

    errors.add(:base, :event_finished) 
    false
  end
end<commit_msg>throw abort instead of returning false<commit_after>module EventOngoingValidation
  extend ActiveSupport::Concern

  included do
    validate :event_ongoing_validation

    before_destroy :event_ongoing_validation
  end

  def event_ongoing_validation
    return unless event&.finished?

    errors.add(:base, :event_finished)
    throw :abort
  end
end
{'fraction_non_alphanumeric': 0.04941860465116279, 'fraction_numerical': 0.0, 'mean_word_length': 4.6016260162601625, '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': '5036554', 'n_tokens_mistral': 203, 'n_tokens_neox': 192, 'n_words': 49}