Open
Description
I'm running Rails 4.2.9 and Ruby 2.3.5. I just upgraded actionpack-action_caching gem from 1.1.1 to 1.2.0. Before, on v1.1.1 I was able to specify the cache_path
with a symbolized method name (without the _url
postfix), like this:
class MyController < ApplicationController
caches_action :my_action, cache_path: :my_cache_path, if: :is_cacheable?
def my_action
...
end
private
def my_cache_path_url
url_for(
only_path: true,
action: "my_action",
format: "json",
page_number: params[:page],
max_updated_at: MyModel.maximum(:updated_at).to_i,
)
end
def is_cacheable?
true
end
end
After updating the gem to v1.2.0, this would only work if I wrapped the cache_path
method in a new Proc
with its full name including the _url
portion:
caches_action :my_action, cache_path: Proc.new { my_cache_path_url }, if: :is_cacheable? # works
It also works with the short lambda syntax:
caches_action :my_action, cache_path: -> { my_cache_path_url }, if: :is_cacheable? # works
Can you verify whether v1.2.0 of the gem hurt the ability to pass in a symbolized url path name to cache_path?:
caches_action :my_action, cache_path: :my_cache_path, if: :is_cacheable? # does not currently work
Metadata
Metadata
Assignees
Labels
No labels