Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reducing subtle duplication of effort/logic
Prior to this commit, when we change attributes for a user we might resave each article. The purpose of the resave is to update some of the cached attributes of an article. This removes some redundant code. The following removed code has an `article.save` call. Which, the callbacks in the article (see below) already clear the cache. ```ruby def resave_articles articles.find_each do |article| if article.path cache_bust = EdgeCache::Bust.new cache_bust.call(article.path) cache_bust.call("#{article.path}?i=i") end article.save end end ``` https://github.com/forem/forem/blob/8e6981aac59e86a9a2c69db1e50fb1119f509c8d/app/models/article.rb#L164 https://github.com/forem/forem/blob/8e6981aac59e86a9a2c69db1e50fb1119f509c8d/app/models/article.rb#L881-L888 This was discovered in triaging #17041
- Loading branch information