diff options
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/caching/actions.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_controller/metal/conditional_get.rb | 7 |
2 files changed, 4 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/caching/actions.rb b/actionpack/lib/action_controller/caching/actions.rb index 0238135bc1..eb3aa05a25 100644 --- a/actionpack/lib/action_controller/caching/actions.rb +++ b/actionpack/lib/action_controller/caching/actions.rb @@ -132,7 +132,7 @@ module ActionController #:nodoc: options.values_at(:cache_path, :store_options, :layout) end - def filter(controller) + def around(controller) cache_layout = @cache_layout.respond_to?(:call) ? @cache_layout.call(controller) : @cache_layout path_options = if @cache_path.respond_to?(:call) diff --git a/actionpack/lib/action_controller/metal/conditional_get.rb b/actionpack/lib/action_controller/metal/conditional_get.rb index 7521deaaca..12ef68ff26 100644 --- a/actionpack/lib/action_controller/metal/conditional_get.rb +++ b/actionpack/lib/action_controller/metal/conditional_get.rb @@ -22,7 +22,7 @@ module ActionController # # class InvoicesController < ApplicationController # etag { current_user.try :id } - # + # # def show # # Etag will differ even for the same invoice when it's viewed by a different current_user # @invoice = Invoice.find(params[:id]) @@ -71,7 +71,7 @@ module ActionController options.assert_valid_keys(:etag, :last_modified, :public) else record = record_or_options - options = { etag: record, last_modified: record.try(:updated_at) }.merge(additional_options) + options = { etag: record, last_modified: record.try(:updated_at) }.merge!(additional_options) end response.etag = combine_etags(options[:etag]) if options[:etag] @@ -162,8 +162,7 @@ module ActionController def expires_now #:doc: response.cache_control.replace(:no_cache => true) end - - + private def combine_etags(etag) [ etag, *etaggers.map { |etagger| instance_exec(&etagger) }.compact ] |