rails/actionpack-action_caching — pull request #2 by LTe (2013-02-09 14:41:26+00:00)
Title: Allow to use non-proc object in cache_path option

You can use :cache_path option with object that respond to #call method.
Before this patch ActionCacheFilter check that object respond to #call
method and execute #instance_exec on controller instance. It was strange
because #instance_exec method can work only with Proc objects.

When you pass Proc object to :cache_option it will be execute #instance_exec
with this Proc otherwise when object is respond to #call method will be called
on this object.

class CachePath
def call(controller)
controller.id
end
end

class TestController < ApplicationController
caches_action :index, :cache_path => CachePath.new
def index; end
end