<commit_before>class Api::V4::Users::PbsController < Api::V4::ApplicationController
  before_action :set_user
  before_action :set_pbs, only: [:index]

  def index
    render json: @pbs, each_serializer: Api::V4::RunSerializer
  end

  private

  def set_user
    @user = User.find_by(name: params[:user_id]) || User.find(params[:user_id])
  rescue ActiveRecord::RecordNotFound
    render not_found(:user, params[:user_id])
  end

  def set_pbs
    @pbs = @user.pbs.includes(:game, :category)
  end
end<commit_msg>Paginate PBs in v4<commit_after>class Api::V4::Users::PbsController < Api::V4::ApplicationController
  before_action :set_user
  before_action :set_pbs, only: [:index]

  def index
    paginate json: @pbs, each_serializer: Api::V4::RunSerializer
  end

  private

  def set_user
    @user = User.find_by(name: params[:user_id]) || User.find(params[:user_id])
  rescue ActiveRecord::RecordNotFound
    render not_found(:user, params[:user_id])
  end

  def set_pbs
    @pbs = @user.pbs.includes(:game, :category)
  end
end
{'fraction_non_alphanumeric': 0.12560386473429952, 'fraction_numerical': 0.00676328502415459, 'mean_word_length': 5.023255813953488, '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': '3098367', 'n_tokens_mistral': 371, 'n_tokens_neox': 370, 'n_words': 76}