# frozen_string_literal: true class Posts::Comments::HistoriesController < ApplicationController before_action :load_post before_action :load_comment before_action :check_auth def show @title = "Comment History on ##{@post.id} for #{@comment.author(current_user&.staff?)}" end private def load_post @post = Post.find(params[:post_id]) end def load_comment @comment = @post.comments.find(params[:comment_id]) end def check_auth authorize! :read, @comment end end