Module: Mongoid::QueryCache::Base
- Defined in:
- lib/mongoid/query_cache.rb
Overview
Included to add behavior for clearing out the query cache on certain operations.
Instance Method Summary collapse
Instance Method Details
#alias_query_cache_clear(*method_names) ⇒ Object
184 185 186 187 188 189 190 191 192 193 194 |
# File 'lib/mongoid/query_cache.rb', line 184 def alias_query_cache_clear(*method_names) method_names.each do |method_name| define_method("#{method_name}_with_clear_cache") do |*args| QueryCache.clear_cache send("#{method_name}_without_clear_cache", *args) end alias_method "#{method_name}_without_clear_cache", method_name alias_method method_name, "#{method_name}_with_clear_cache" end end |