<commit_before>module DirtyAssociations
  
  VERSION = '0.3.1'
  
  class << self
    def included base
      base.extend ClassMethods
    end
  end
  
  module ClassMethods
    # Calling this defines all other methods.
    def has_dirty_associations(*associations)
      include InstanceMethods
      
      associations_to_watch = case associations
        when [], [:all]  then
          self.reflections.keys
        when [:children] then
          self.reflections.select { |assoc, reflection|
            [:has_one, :has_many, :has_and_belongs_to_many, :composed_of].include? reflection.macro }.map(&:first)
        when [:parents]  then
          self.reflections.select { |assoc, reflection|
            [:belongs_to, :has_and_belongs_to_many].include? reflection.macro }.map(&:first)
        else
          associations
        end  
        
      write_inheritable_attribute(:watched_associations, associations_to_watch)

      class_eval do
        default_scope :include => associations_to_watch
        <commit_msg>Update version constant to 0.3.2<commit_after>module DirtyAssociations
  
  VERSION = '0.3.2'
  
  class << self
    def included base
      base.extend ClassMethods
    end
  end
  
  module ClassMethods
    # Calling this defines all other methods.
    def has_dirty_associations(*associations)
      include InstanceMethods
      
      associations_to_watch = case associations
        when [], [:all]  then
          self.reflections.keys
        when [:children] then
          self.reflections.select { |assoc, reflection|
            [:has_one, :has_many, :has_and_belongs_to_many, :composed_of].include? reflection.macro }.map(&:first)
        when [:parents]  then
          self.reflections.select { |assoc, reflection|
            [:belongs_to, :has_and_belongs_to_many].include? reflection.macro }.map(&:first)
        else
          associations
        end  
        
      write_inheritable_attribute(:watched_associations, associations_to_watch)

      class_eval do
        default_scope :include => associations_to_watch
        
{'fraction_non_alphanumeric': 0.07992296581608088, 'fraction_numerical': 0.004333172845450169, 'mean_word_length': 2.516074450084602, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '7117489', 'n_tokens_mistral': 606, 'n_tokens_neox': 598, 'n_words': 132}