<commit_before>class ResumesController < ApplicationController
  before_action :set_resume, only: [:show]

  layout "resume", only: [:show]
  respond_to :html, :json

  def show
    # Only allow viewing of published resumes, or resumes a user owns
    if not @resume.published and (!user_signed_in? or current_user.id != @resume.user.id)
      return head :forbidden
    end

    @skills_by_cat = SkillCategory.with_skills

    if stale?(@resume, public: true)
      respond_to do |format|
        format.html
        format.json
        format.md
        format.pdf do
          render pdf:           @resume.name,
                 layout:        'resume.pdf.erb',
                 template:      'resumes/show.html.erb',
                 page_size:     'Letter'
        end
      end
    end
  end

  private
    def set_resume
      @resume = Resume.find(params[:id])
    end
end
<commit_msg>Don't use the print media type in PDFs<commit_after>class ResumesController < ApplicationController
  before_action :set_resume, only: [:show]

  layout "resume", only: [:show]
  respond_to :html, :json

  def show
    # Only allow viewing of published resumes, or resumes a user owns
    if not @resume.published and (!user_signed_in? or current_user.id != @resume.user.id)
      return head :forbidden
    end

    @skills_by_cat = SkillCategory.with_skills

    if stale?(@resume, public: true)
      respond_to do |format|
        format.html
        format.json
        format.md
        format.pdf do
          render pdf:           @resume.name,
                 layout:        'resume.pdf.erb',
                 template:      'resumes/show.html.erb',
                 page_size:     'Letter',
                 print_media_type: false
        end
      end
    end
  end

  private
    def set_resume
      @resume = Resume.find(params[:id])
    end
end

{'fraction_non_alphanumeric': 0.08562197092084006, 'fraction_numerical': 0.0, 'mean_word_length': 2.0211382113821137, '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': '350337', 'n_tokens_mistral': 564, 'n_tokens_neox': 568, 'n_words': 155}