<commit_before>module PaperTrail
  module Controller

    def self.included(base)
      base.before_filter :set_paper_trail_enabled_for_controller
      base.before_filter :set_paper_trail_whodunnit
      base.before_filter :set_paper_trail_controller_info
    end

    protected

    # Returns the user who is responsible for any changes that occur.
    # By default this calls `current_user` and returns the result.
    # 
    # Override this method in your controller to call a different
    # method, e.g. `current_person`, or anything you like.
    def user_for_paper_trail
      current_user rescue nil
    end

    # Returns any information about the controller or request that you
    # want PaperTrail to store alongside any changes that occur.  By
    # default this returns an empty hash.
    #
    # Override this method in your controller to return a hash of any
    # information you need.  The hash's keys must correspond to columns
    # in your `versions` table, so don't forget to add any new columns
    # you need.
    #
    # For example:
    #
    #     {:ip => request.remote_ip, :user_agent => request.user_agent}
    #<commit_msg>Condensing code in the 'included' method on the Controller module.<commit_after>module PaperTrail
  module Controller

    def self.included(base)
      base.before_filter :set_paper_trail_enabled_for_controller
      base.before_filter :set_paper_trail_whodunnit, :set_paper_trail_controller_info
    end

    protected

    # Returns the user who is responsible for any changes that occur.
    # By default this calls `current_user` and returns the result.
    #
    # Override this method in your controller to call a different
    # method, e.g. `current_person`, or anything you like.
    def user_for_paper_trail
      current_user rescue nil
    end

    # Returns any information about the controller or request that you
    # want PaperTrail to store alongside any changes that occur.  By
    # default this returns an empty hash.
    #
    # Override this method in your controller to return a hash of any
    # information you need.  The hash's keys must correspond to columns
    # in your `versions` table, so don't forget to add any new columns
    # you need.
    #
    # For example:
    #
    #     {:ip => request.remote_ip, :user_agent => request.user_agent}
    #
{'fraction_non_alphanumeric': 0.05431993156544055, 'fraction_numerical': 0.0, 'mean_word_length': 3.046712802768166, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '3686637', 'n_tokens_mistral': 657, 'n_tokens_neox': 640, 'n_words': 258}