lib/pagelet_rails/concerns/cache.rb in pagelet_rails-0.1.6 vs lib/pagelet_rails/concerns/cache.rb in pagelet_rails-0.1.7

- old
+ new

@@ -24,20 +24,22 @@ store_options = cache_defaults.except(:cache_path) store_options[:expires_in] = pagelet_options.expires_in if pagelet_options.expires_in cache_path = pagelet_options.cache_path || cache_defaults[:cache_path] - cache_path = if cache_path.is_a?(Proc) - self.instance_exec(self, &cache_path) - elsif cache_path.respond_to?(:call) - cache_path.call(self) - elsif cache_path.is_a?(String) - { - custom: cache_path - } - else - cache_path - end + cache_path = + if cache_path.is_a?(Proc) + self.instance_exec(self, &cache_path) + elsif cache_path.respond_to?(:call) + cache_path.call(self) + elsif cache_path.is_a?(String) + { + custom: cache_path + } + else + cache_path + end + cache_path ||= {} cache_path[:controller] = params[:controller] cache_path[:action] = params[:action] path_object = ActionController::Caching::Actions::ActionCachePath.new(self, cache_path)