<commit_before>class LogController < ApplicationController
  helper LogHelper

  before_filter do
    if cannot? :manage, :all
      redirect_to root_path, notice: "You cannot view logs as a non-admin."
    end
  end

  def index
    # Past paper_trail 2.7-stable, Version is namespaced as PaperTrail::Version
    # and so this line will break.
    @versions = Version.order("id desc").all
    # render layout: 'application_with_sidebar'
    @title = "to all Items"
  end

  def version
    @version = Version.find_by_id(params[:id])
<commit_msg>Changing to a more idiomatic CanCan authorization expression<commit_after>class LogController < ApplicationController
  helper LogHelper

  authorize_resource, :class => false

  def index
    # Past paper_trail 2.7-stable, Version is namespaced as PaperTrail::Version
    # and so this line will break.
    @versions = Version.order("id desc").all
    # render layout: 'application_with_sidebar'
    @title = "to all Items"
  end

  def version
    @version = Version.find_by_id(params[:id])

{'fraction_non_alphanumeric': 0.08277189605389798, 'fraction_numerical': 0.0038498556304138597, 'mean_word_length': 3.727272727272727, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '105741', 'n_tokens_mistral': 317, 'n_tokens_neox': 301, 'n_words': 102}