Please sign in to comment.
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
- Loading branch information...
Showing with 35 additions and 1 deletion.