hawkins.io icon indicating copy to clipboard operation
hawkins.io copied to clipboard

Part 2: HTTP Caching on collection of objects

Open deiga opened this issue 11 years ago • 0 comments

In Part 2 you have the following code:

def index
  @posts = Post.scoped
  if stale? @posts do
    respond_with @posts
  end
end

This code looks like it shouldn't work, as fresh_when has no way to handle arrays. In fact on Mongoid (can't test AR) it fails because Array doesn't have and update_at methdod.

I know that your code segments are not supposed to work straight away, but I think this one is too unclear as to what you are trying to relate to the reader.

deiga avatar Mar 24 '13 11:03 deiga