<commit_before>Forem::TopicsController.class_eval do
  load_and_authorize_resource :forum
  skip_before_filter :block_spammers
  append_before_filter :shim

  def mark_read
    unread = Forem::Post.joins(:topic).unread_by(current_user).where('forem_topics.id' => @topic.id)
    if unread.count > 0
      Forem::Post.mark_as_read! unread.all, :for => current_user
    end
    redirect_to main_app.course_forum_topic_url(@course, @forum, @topic)
  end

  def next_unread
    unread = Forem::Post.joins(:topic).unread_by(current_user).where('forem_topics.id <> ?', @topic.id)
    if unread.count > 0<commit_msg>Let's stay in the same forum section for now<commit_after>Forem::TopicsController.class_eval do
  load_and_authorize_resource :forum
  skip_before_filter :block_spammers
  append_before_filter :shim

  def mark_read
    unread = Forem::Post.joins(:topic).unread_by(current_user).where('forem_topics.id' => @topic.id)
    if unread.count > 0
      Forem::Post.mark_as_read! unread.all, :for => current_user
    end
    redirect_to main_app.course_forum_topic_url(@course, @forum, @topic)
  end

  def next_unread
    unread = Forem::Post.joins(:topic).unread_by(current_user).where('forem_forums.id = ? AND forem_topics.id <> ? ', @forum.id, @topic.id)
    if unread.count > 0
{'fraction_non_alphanumeric': 0.11769290724863601, 'fraction_numerical': 0.003117692907248636, 'mean_word_length': 4.863013698630137, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '3870927', 'n_tokens_mistral': 485, 'n_tokens_neox': 464, 'n_words': 78}