This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def show | |
@article = Article.find(params[:id]) | |
if stale?(etag: @article, last_modified: @article.created_at) | |
@statistics = @article.really_expensive_call | |
render json: @article | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user = User.last | |
user.updated_at | |
#=> Fri, 15 Jun 2018 16:00:02 BST +01:00 | |
user.update(email: "[email protected]") | |
user.updated_at | |
#=> Fri, 22 Jun 2018 11:08:03 BST +01:00 | |
user.reload! | |
user.update_column(:email, "[email protected]") |