module Split::Cacheable::Helper::InstanceMethods

Public Instance Methods

current_tests_and_variations() click to toggle source

Controller helper method to get the current active tests + variations in the form of a partial cache key

# File lib/split_cacheable/helper.rb, line 17
def current_tests_and_variations
    Split::Cacheable::Adapter.new(self, self.action_name.to_sym).get_current_variations
end
fragment_cache_key(key) click to toggle source

Patch the default ActionController::Base action_cache key creation by prepending our current tests + variation key generated in the next method

Calls superclass method
# File lib/split_cacheable/helper.rb, line 12
def fragment_cache_key(key)
    super("#{current_tests_and_variations}/#{key}")
end