Module: Mongoid::AttributeCache
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/mongoid_misc/attribute_cache.rb
Instance Method Summary collapse
Instance Method Details
#cache ⇒ Object
4 5 6 |
# File 'lib/mongoid_misc/attribute_cache.rb', line 4 def cache @cache ||= {} end |
#clear_cache ⇒ Object
8 9 10 |
# File 'lib/mongoid_misc/attribute_cache.rb', line 8 def clear_cache @cache = {} end |
#reload ⇒ Object
12 13 14 15 |
# File 'lib/mongoid_misc/attribute_cache.rb', line 12 def reload @cache.clear if @cache super end |