<commit_before>class ChatMailerPreview < ActionMailer::Preview
  def mentioned_in_chat


    room = ChatRoom.joins(wip: :events).sample
    event = room.wip.events.sample

    user = User.sample
    ChatMailer.mentioned_in_chat(user.id, event.id)
  end
end<commit_msg>better email preview query for mentioned_in_chat<commit_after>class ChatMailerPreview < ActionMailer::Preview
  def mentioned_in_chat
    begin
      @event = Event.uncached { Event.joins(wip: :chat_room).where("body ilike '% @core%'").order("Random()").first }
    end while @event.mentioned_users.size == 0

    user = @event.mentioned_users.first
    ChatMailer.mentioned_in_chat(user.id, @event.id)
  end
end
{'fraction_non_alphanumeric': 0.11029411764705882, 'fraction_numerical': 0.0014705882352941176, 'mean_word_length': 4.491935483870968, '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': '6071286', 'n_tokens_mistral': 231, 'n_tokens_neox': 220, 'n_words': 42}