3 ms·
Imagine you have User has_many Comments. When someone's username is updated, you might need to update all the user's cached html comment fragments to include t
by joevandyk 15y ago
Imagine you have User has_many Comments. When someone's username is updated, you might need to update all the user's cached html comment fragments to include the new username.
However, ActiveRecord doesn't support touch on has_many relations. (It probably shouldn't, as updating the username would mean updating/touching thousands (or more) comment rows).
Also, if you have to update the database outside of ActiveRecord for any reason, you could be screwed - the cache would become out of sync with the database.
- nfm 15y agoCheers, a helpful and extremely likely case!