<commit_before>class TopicsController < ApplicationController
    include TopicsHelper

    before_action :require_user, only: [:create, :update, :destroy]
    after_action :verify_authorized
   
    respond_to :html, :js, :json

    # GET /topics/autocomplete_topic
    def autocomplete_topic
        term = params[:term]
        if term && !term.empty?
            @topics = policy_scope(Topic.where('LOWER("name") like ?', term.downcase + '%')).order('"name"')
        else
            @topics = []
        end
        render json: autocomplete_array_json(@topics)
    end

    # GET topics/:id
    def show
        @topic = Topic.find(params[:id])
        authorize! @topic
<commit_msg>pundit: exclude topic action<commit_after>class TopicsController < ApplicationController
    include TopicsHelper

    before_action :require_user, only: [:create, :update, :destroy]
    after_action :verify_authorized, except: :autocomplete_topic
   
    respond_to :html, :js, :json

    # GET /topics/autocomplete_topic
    def autocomplete_topic
        term = params[:term]
        if term && !term.empty?
            @topics = policy_scope(Topic.where('LOWER("name") like ?', term.downcase + '%')).order('"name"')
        else
            @topics = []
        end
        render json: autocomplete_array_json(@topics)
    end

    # GET topics/:id
    def show
        @topic = Topic.find(params[:id])
        authorize! @topic

{'fraction_non_alphanumeric': 0.1151685393258427, 'fraction_numerical': 0.0, 'mean_word_length': 2.730366492146597, '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': '7132541', 'n_tokens_mistral': 434, 'n_tokens_neox': 424, 'n_words': 97}