Skip to content

Commit

Permalink
Do not rely on having updated_at set.
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Jun 24, 2010
1 parent 252a302 commit e74acf8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/responders/http_cache_responder.rb
Expand Up @@ -23,8 +23,7 @@ def to_format

def do_http_cache!
timestamp = resources.flatten.map do |resource|
next unless resource.respond_to?(:updated_at)
resource.updated_at.utc
resource.updated_at.try(:utc) if resource.respond_to?(:updated_at)
end.compact.max

controller.response.last_modified ||= timestamp if timestamp
Expand Down

0 comments on commit e74acf8

Please sign in to comment.