module Mongoid::QueryCache::Base
Included to add behaviour for clearing out the query cache on certain operations.
@since 4.0.0
Public Instance Methods
alias_query_cache_clear(*method_names)
click to toggle source
# File lib/mongoid/query_cache.rb, line 176 def alias_query_cache_clear(*method_names) method_names.each do |method_name| class_eval " def #{method_name}_with_clear_cache(*args) QueryCache.clear_cache #{method_name}_without_clear_cache(*args) end ", __FILE__, __LINE__ + 1 alias_method "#{method_name}_without_clear_cache", method_name alias_method method_name, "#{method_name}_with_clear_cache" end end