<commit_before>module Forem
  class ForumsController < Forem::ApplicationController
    load_and_authorize_resource
    helper 'forem/topics'

    def index
      @forums = Forem::Forum.select("forem_forums.*, forem_categories.name as cat_name, forem_categories.id AS cat_id").joins(:category)
    end

    def show
      @forum = Forem::Forum.find(params[:id])
      @topics = forem_admin? ? @forum.topics : @forum.topics.visible
      @topics = @topics.by_pinned_or_most_recent_post.page(params[:page]).per(20)
    end

    private
      def current_ability
        Forem::Ability.new(forem_user)<commit_msg>Removed tables hard code per #74<commit_after>module Forem
  class ForumsController < Forem::ApplicationController
    load_and_authorize_resource
    helper 'forem/topics'

    def index
      @forums = Forem::Forum.select("#{Forem::Forum.quoted_table_name}.*,#{Forem::Category.quoted_table_name} as cat_name,#{Forem::Category.quoted_table_name}.id AS cat_id").joins(:category)
    end

    def show
      @forum = Forem::Forum.find(params[:id])
      @topics = forem_admin? ? @forum.topics : @forum.topics.visible
      @topics = @topics.by_pinned_or_most_recent_post.page(params[:page]).per(20)
    end

    private
      def current_ability
        Forem::Ability.new(forem_user)
{'fraction_non_alphanumeric': 0.11600928074245939, 'fraction_numerical': 0.004640371229698376, 'mean_word_length': 4.0546875, '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': '6190299', 'n_tokens_mistral': 456, 'n_tokens_neox': 437, 'n_words': 70}