<commit_before>require 'active_support/concern'
module BeRevisable
  module Logable
    extend ActiveSupport::Concern

    included do

      scope :revisable_with_changes, lambda { includes(revision_info: :revision_changes) }

      # Log change of user
      def log_change(user_id, description)
        revision_info.revision_changes.create(user_id: user_id, description: description, change_date: DateTime.current)<commit_msg>Update changes logs logic: Find changes in client side using json patch and send them to server.<commit_after>require 'active_support/concern'
module BeRevisable
  module Logable
    extend ActiveSupport::Concern

    included do

      scope :revisable_with_changes, lambda { includes(revision_info: :revision_changes) }

      # Log change of user
      def log_change(user_id, description, payload='')
        revision_info.revision_changes.create(user_id: user_id, description: description, payload: payload, change_date: DateTime.current)
{'fraction_non_alphanumeric': 0.0698869475847893, 'fraction_numerical': 0.0, 'mean_word_length': 4.832335329341317, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1752784', 'n_tokens_mistral': 275, 'n_tokens_neox': 267, 'n_words': 74}