Module: Redundancy::ClassMethods
- Defined in:
- lib/redundancy.rb
Instance Method Summary collapse
- #cache_column(association, attribute, options = {}) ⇒ Object
- #cache_method(association, attribute, options = {}) ⇒ Object
- #redundacies ⇒ Object
- #update_redundacies ⇒ Object
Instance Method Details
#cache_column(association, attribute, options = {}) ⇒ Object
32 33 34 35 |
# File 'lib/redundancy.rb', line 32 def cache_column association, attribute, = {} .assert_valid_keys(:cache_column, :inverse_of) Utils.cache_column self, association, attribute, end |
#cache_method(association, attribute, options = {}) ⇒ Object
37 38 39 40 |
# File 'lib/redundancy.rb', line 37 def cache_method association, attribute, = {} .assert_valid_keys(:cache_column, :inverse_of) Utils.cache_method self, association, attribute, end |
#redundacies ⇒ Object
42 43 44 |
# File 'lib/redundancy.rb', line 42 def redundacies @redundacies ||= [] end |
#update_redundacies ⇒ Object
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 |