<commit_before>module ActsAsChangesetable
  module ChangeableHistory
    # Upon including this module, call setup.
    def self.included(base)
      base.send(:extend, ClassMethods)
      base.changeable_history_setup
    end
    
    # Returns the associated changeable
    def changeable
      self.changeable_class.find(self.send(self.changeable_fk))
    end
    
    # Checks the associated changeable and updates it if needed
    def sync_changeable!
      self.changeable.sync_changeable! if(self.changeable.updated_at < self.updated_at)
    end
    
    module ClassMethods
      # Turns of Rails' autotimestamping if we want to copy timestamps ourselves
      # Then add a belongs_to for :changeset
      def changeable_history_setup
        unless self.changesetable_options.no_copy_timestamps?<commit_msg>Fix bug with acts_as_paranoid (find_with_deleted added)<commit_after>module ActsAsChangesetable
  module ChangeableHistory
    # Upon including this module, call setup.
    def self.included(base)
      base.send(:extend, ClassMethods)
      base.changeable_history_setup
    end
    
    # Returns the associated changeable
    def changeable
      return self.changeable_class.find(self.send(self.changeable_fk)) unless (self.changeable_class.respond_to?(:find_with_deleted))
      self.changeable_class.find_with_deleted(self.send(self.changeable_fk))
    end
    
    # Checks the associated changeable and updates it if needed
    def sync_changeable!
      self.changeable.sync_changeable! if(self.changeable.updated_at < self.updated_at)
    end
    
    module ClassMethods
      # Turns of Rails' autotimestamping if we want to copy timestamps ourselves
      # Then add a belongs_to for :changeset
      def changeable_history_setup
        unless self.changesetable_options.no_copy_timestamps?
{'fraction_non_alphanumeric': 0.056074766355140186, 'fraction_numerical': 0.0, 'mean_word_length': 3.55, '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': '6955485', 'n_tokens_mistral': 534, 'n_tokens_neox': 525, 'n_words': 132}