spree/spree — pull request #3190 by balexand (2013-06-11 21:56:11+00:00)
Title: Add `touch: true` option to `Spree::Asset#viewable` association

We're using a fragment cache like:

```erb
<% cache product do %>
...
<% end %>
```

But when a product images is created/updated/destroyed then `product.updated_at` does not get updated and the cache does not get invalidated. This pull request fixes that.

This is a common caching paradigm in Rails. If you are unfamiliar with it, then check out this [Railscast](http://railscasts.com/episodes/90-fragment-caching-revised). Also, `Spree::Variant` [already does this](https://github.com/spree/spree/blob/7abd266f50d8c7bbb609c086df78a164f1cf200b/core/app/models/spree/variant.rb#L3).