Module: Redundancy::ClassMethods

Defined in:
lib/redundancy.rb

Instance Method Summary collapse

Instance Method Details

#cache_column(association, attribute, options = {}) ⇒ Object



32
33
34
35
# File 'lib/redundancy.rb', line 32

def cache_column association, attribute, options = {}
  options.assert_valid_keys(:cache_column, :inverse_of)
  Utils.cache_column self, association, attribute, options
end

#cache_method(association, attribute, options = {}) ⇒ Object



37
38
39
40
# File 'lib/redundancy.rb', line 37

def cache_method association, attribute, options = {}
  options.assert_valid_keys(:cache_column, :inverse_of)
  Utils.cache_method self, association, attribute, options
end

#redundaciesObject



42
43
44
# File 'lib/redundancy.rb', line 42

def redundacies
  @redundacies ||= []
end

#update_redundaciesObject



46
47
48
49
50
51
52
# File 'lib/redundancy.rb', line 46

def update_redundacies
  all.each do |record|
    redundacies.each do |redundancy|
      redundancy.force_update!(record)
    end
  end
end