<commit_before>module Scrutanize
  class AuditLogsController < Scrutanize::ApplicationController

    def index
      session[:audit_log_path] = audit_report_audit_logs_path(report)
      @audit_logs = AuditLog.not_deleted
    end

    def show_all
      session[:audit_log_path] = audit_report_show_all_audit_logs_path(report)
      @audit_logs = AuditLog.all
      render :index
    end

    def destroy
      if audit_log.soft_delete
        redirect_to session[:audit_log_path]
      else
        render :index
      end
    end

    def restore
      if audit_log.restore
        redirect_to session[:audit_log_path]
      else
        render :index
      end
    end

    private

    def report
      @report ||= AuditReport.find params[:audit_report_id]
    end
    helper_method :report

    def audit_log
      @audit_log ||= AuditLog.find(params[:id])
    end
  end
end
<commit_msg>[bugfix] scope audit logs to report<commit_after>module Scrutanize
  class AuditLogsController < Scrutanize::ApplicationController

    def index
      session[:audit_log_path] = audit_report_audit_logs_path(report)
      @audit_logs = report.audit_logs.not_deleted
    end

    def show_all
      session[:audit_log_path] = audit_report_show_all_audit_logs_path(report)
      @audit_logs = report.audit_logs.all
      render :index
    end

    def destroy
      if audit_log.soft_delete
        redirect_to session[:audit_log_path]
      else
        render :index
      end
    end

    def restore
      if audit_log.restore
        redirect_to session[:audit_log_path]
      else
        render :index
      end
    end

    private

    def report
      @report ||= AuditReport.find params[:audit_report_id]
    end
    helper_method :report

    def audit_log
      @audit_log ||= AuditLog.find(params[:id])
    end
  end
end

{'fraction_non_alphanumeric': 0.06133625410733844, 'fraction_numerical': 0.0, 'mean_word_length': 2.610671936758893, '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': '4435392', 'n_tokens_mistral': 603, 'n_tokens_neox': 585, 'n_words': 123}