Created
January 9, 2018 13:35
-
-
Save raonirenosto/2b532988bed7782b4a07b8cc07dedb2e to your computer and use it in GitHub Desktop.
Pegar if-modified-since apenas dos itens que foram atualizados
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
if_modified_since = Time.zone.parse(request.headers['If-Modified-Since']) || Time.zone | |
@users = User.where("updated_at > ?", if_modified_since).order(updated_at: :desc) | |
if stale?(@users.first) | |
render json: @users | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment