From c7331e057b4dd60aa810d3b412c43174a582432e Mon Sep 17 00:00:00 2001 From: claudiob Date: Tue, 10 Feb 2015 17:02:24 -0800 Subject: Fix wrong kwarg "record" from #18872 PR #18772 changed the parameters of `stale?` to use `kwargs`. [As for this comment](https://github.com/rails/rails/pull/18872/files#r24456288) the default value for the `etag` parameter should be `record`, not `nil`. This commit fixes the code and introduces a test that: - passed before #18872 - fails on the current master (after #18772) - passes again after setting the default value of `etag` to `record`. --- actionpack/lib/action_controller/metal/conditional_get.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_controller/metal/conditional_get.rb b/actionpack/lib/action_controller/metal/conditional_get.rb index bd7689a843..3a5929adef 100644 --- a/actionpack/lib/action_controller/metal/conditional_get.rb +++ b/actionpack/lib/action_controller/metal/conditional_get.rb @@ -155,7 +155,7 @@ module ActionController # super if stale? @article, template: 'widgets/show' # end # - def stale?(record = nil, etag: nil, last_modified: nil, public: nil, template: nil) + def stale?(record = nil, etag: record, last_modified: nil, public: nil, template: nil) fresh_when(record, etag: etag, last_modified: last_modified, public: public, template: template) !request.fresh?(response) end -- cgit v1.2.3