diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-02-10 23:05:53 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-02-10 23:05:53 -0200 |
commit | 17d9996c91918df4c32b8ed7c67c2bbe715cfc9d (patch) | |
tree | 3afe4104b9c54a852683b557d39774e03c633474 | |
parent | 162581a448ac6f3e52901a90000336f394226381 (diff) | |
parent | c7331e057b4dd60aa810d3b412c43174a582432e (diff) | |
download | rails-17d9996c91918df4c32b8ed7c67c2bbe715cfc9d.tar.gz rails-17d9996c91918df4c32b8ed7c67c2bbe715cfc9d.tar.bz2 rails-17d9996c91918df4c32b8ed7c67c2bbe715cfc9d.zip |
Merge pull request #18884 from rails/fix-kwarg-on-stale
Fix wrong kwarg "record" from #18872
-rw-r--r-- | actionpack/lib/action_controller/metal/conditional_get.rb | 2 | ||||
-rw-r--r-- | actionpack/test/controller/render_test.rb | 1 |
2 files changed, 2 insertions, 1 deletions
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 diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb index 1c3f436cfa..a5dd96ae91 100644 --- a/actionpack/test/controller/render_test.rb +++ b/actionpack/test/controller/render_test.rb @@ -299,6 +299,7 @@ class LastModifiedRenderTest < ActionController::TestCase get :conditional_hello_with_record assert_equal 304, @response.status.to_i assert @response.body.blank? + assert_not_nil @response.etag assert_equal @last_modified, @response.headers['Last-Modified'] end |