rails/rails — pull request #5719 by robotmay (2012-04-03 15:32:17+00:00)
Title: Adds support for passing multiple models to fresh_when

Alrighty, this is my first time (I think) submitting a pull request to Rails, so please let me know if I need to do anything differently.

This is a small patch to ActionController::ConditionalGet.fresh_when to make it accept multiple models as an argument, like you can with the cache helper in ActionView. Seeing as how fresh_when is just after an etag & last modified timestamp, all it does is sort based on the updated_at attribute and use the most recently updated model for the response.

Please let me know if there's a better way to do this or what changes I could make to improve it.