Skip to content

Commit 5ff2b73

Browse files
committed
Small tweak the ConditionalGet documentation
Time#utc does not need to be called when passing the object to :last_modified since it is called internally to Rails.
1 parent 117daba commit 5ff2b73

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

actionpack/lib/action_controller/metal/conditional_get.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module ConditionalGet
1717
#
1818
# def show
1919
# @article = Article.find(params[:id])
20-
# fresh_when(:etag => @article, :last_modified => @article.created_at.utc, :public => true)
20+
# fresh_when(:etag => @article, :last_modified => @article.created_at, :public => true)
2121
# end
2222
#
2323
# This will render the show template if the request isn't sending a matching etag or
@@ -48,7 +48,7 @@ def fresh_when(options)
4848
# def show
4949
# @article = Article.find(params[:id])
5050
#
51-
# if stale?(:etag => @article, :last_modified => @article.created_at.utc)
51+
# if stale?(:etag => @article, :last_modified => @article.created_at)
5252
# @statistics = @article.really_expensive_call
5353
# respond_to do |format|
5454
# # all the supported formats

0 commit comments

Comments
 (0)