jnunemaker/mongomapper — pull request #394 by bryckbost (2012-03-02 14:52:40+00:00)
Title: Adding touch support

This pull request adds support for calling `.touch` on a record to update its `updated_at` timestamp.

It also adds support through a `belongs_to` association. In this case, when the `:touch` option exists, it will touch the associated object.

```
class Album
timestamps!
many :tracks
end

class Track
belongs_to :album, :touch => true
end

album.touch # will set the update_at attribute

track = album.tracks.build
track.save # will trigger a touch callback on the associated album
```

We found adding touch support to be a simple approach to invalidating etags. Let me know what you think!

Thanks!