Module: Cashier
- Defined in:
- lib/controller_helper.rb,
lib/railtie.rb,
lib/version.rb,
lib/matchers.rb
Overview
Hooks into ApplicationController’s write_fragment method. write_fragment is used for action and fragment caching. Create an alias method chain to call our customer method which stores the associated key with the tag in a Redis Set. Then we can expire all those keys from anywhere in the code using Rails.cache.delete
I use alias_method_chain instead of calling ‘super’ because there is a very rare case where someone may have redfined ‘write_fragment’ in their own controllers. Using an alias method chain keeps those methods intact.
Defined Under Namespace
Modules: ControllerHelper, Matchers Classes: Railtie
Constant Summary collapse
- VERSION =
"0.2.0"