<commit_before># -*- encoding : utf-8 -*-

module Mongoid
module Userstamp

  module Model

    extend ActiveSupport::Concern

    included do

      belongs_to mongoid_userstamp_config.created_name, class_name: mongoid_userstamp_config.user_model
      belongs_to mongoid_userstamp_config.updated_name, class_name: mongoid_userstamp_config.user_model

      before_create :set_created_by
      before_save :set_updated_by

      protected<commit_msg>Add inverse_of to relations, to prevent ambiguity when the user model has another relation to the userstamped model<commit_after># -*- encoding : utf-8 -*-

module Mongoid
module Userstamp

  module Model

    extend ActiveSupport::Concern

    included do

      belongs_to mongoid_userstamp_config.created_name, class_name: mongoid_userstamp_config.user_model, inverse_of: nil
      belongs_to mongoid_userstamp_config.updated_name, class_name: mongoid_userstamp_config.user_model, inverse_of: nil

      before_create :set_created_by
      before_save :set_updated_by

      protected
{'fraction_non_alphanumeric': 0.051059730250481696, 'fraction_numerical': 0.0019267822736030828, 'mean_word_length': 4.468421052631579, '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': '5815286', 'n_tokens_mistral': 320, 'n_tokens_neox': 308, 'n_words': 72}