<commit_before>class Event
  include ActiveModel::Validations
  include Events::Concerns::ViewLogic

  attr_accessor :start_time, :end_time, :priority, :room_id
  attr_reader :payload
  validate :start_time_valid
  def initialize start_time, end_time, priority, payload = nil, room_id = nil
    @start_time = start_time
    @end_time = end_time
    @priority = priority
    @payload = payload
    @room_id = room_id
  end

  def start_time_valid
    errors.add(:start_time, "must be less than end time") unless start_time < end_time
  end

  def duration
    end_time - start_time
  end

end<commit_msg>Get rid of validation overhead on events.<commit_after>class Event
  include Events::Concerns::ViewLogic

  attr_accessor :start_time, :end_time, :priority, :room_id
  attr_reader :payload
  def initialize start_time, end_time, priority, payload = nil, room_id = nil
    @start_time = start_time
    @end_time = end_time
    @priority = priority
    @payload = payload
    @room_id = room_id
  end

  def valid?
    return false unless start_time < end_time
    true
  end

  def duration
    end_time - start_time
  end

end
{'fraction_non_alphanumeric': 0.06914893617021277, 'fraction_numerical': 0.0, 'mean_word_length': 3.804255319148936, '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': '3469953', 'n_tokens_mistral': 370, 'n_tokens_neox': 361, 'n_words': 105}