Merge pull request #18884 from rails/fix-kwarg-on-stale
Fix wrong kwarg "record" from #18872
This commit is contained in:
commit
17d9996c91
@ -155,7 +155,7 @@ def fresh_when(record = nil, etag: record, last_modified: nil, public: false, te
|
||||
# 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
|
||||
|
@ -299,6 +299,7 @@ def test_request_not_modified_with_record
|
||||
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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user