<commit_before>module Forem
  class ModerationController < ApplicationController
    helper 'forem/posts'

    def index
      @posts = forum.posts.pending_review.topic_not_pending_review
      @topics = forum.topics.pending_review
    end

    def posts
      Post.moderate!(params[:posts] || [])
      flash[:notice] = t('forem.posts.moderation.success')
      redirect_to forum_moderator_tools_path(forum)
    end

    private

    def forum
      @forum = Forum.find(params[:forum_id])
    end

    helper_method :forum
  end
end<commit_msg>Redirect back to previous screen after posts have been moderated<commit_after>module Forem
  class ModerationController < ApplicationController
    helper 'forem/posts'

    def index
      @posts = forum.posts.pending_review.topic_not_pending_review
      @topics = forum.topics.pending_review
    end

    def posts
      Post.moderate!(params[:posts] || [])
      flash[:notice] = t('forem.posts.moderation.success')
      redirect_to :back
    end

    private

    def forum
      @forum = Forum.find(params[:forum_id])
    end

    helper_method :forum
  end
end
{'fraction_non_alphanumeric': 0.08715184186882301, 'fraction_numerical': 0.0, 'mean_word_length': 3.1259259259259258, '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': '6638123', 'n_tokens_mistral': 352, 'n_tokens_neox': 326, 'n_words': 72}