I think the new functionality in edge rails will do what you want:
belongs_to :user, :touch => true
This way, whenever you save or delete a photo instance, it’ll ‘touch’
its parent user, and update the updated_at timestamp.
This will require you to upgrade to edge rails, though.
Looking at your attempt, though, I’m not sure this is what you want. Are
you also using the “updated_by” attribute of the photo to save the id of
the user that changed it?
Carlos S. wrote:
I have nested resources as follows: ‘albums has_many photos’.
Whenever someone edits photos, I would like update time stamp on albums.
I tried to do this like:
@photos.albums.updated_by = @currentusername
But, this is not updating albums. I don’t see anything happening in the
database log or mongrel log.