docbrown/app
Jeremy Friesen 3a08716ad3
Reducing subtle duplication of effort/logic (#17078)
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
```

8e6981aac5/app/models/article.rb (L164)

8e6981aac5/app/models/article.rb (L881-L888)

This was discovered in triaging forem/forem#17041
2022-04-01 13:32:44 -04:00
..
assets Added a way to sort comments on an article (#16686) 2022-04-01 09:26:18 -05:00
controllers Added a way to sort comments on an article (#16686) 2022-04-01 09:26:18 -05:00
decorators [Small win] Add display name to campaign settings (#16653) 2022-02-22 10:01:52 -05:00
errors Favoring re-use of authorization error (#16992) 2022-03-24 08:16:28 -04:00
forms Using a Form Object that will persist for the Creator Settings Form (#15684) 2021-12-10 17:07:40 +02:00
helpers Replace listings tag component (#16855) 2022-03-30 16:51:40 +01:00
javascript Added a way to sort comments on an article (#16686) 2022-04-01 09:26:18 -05:00
lib Optimize URL.database_available? (#16968) 2022-03-22 13:04:12 -04:00
liquid_tags youtube tag timestamp format fix (#16873) 2022-03-22 08:55:45 -06:00
mailers "Reply to" and "From" Email addresses for SMTP Configurations (#16499) 2022-02-16 16:14:54 +02:00
models Reducing subtle duplication of effort/logic (#17078) 2022-04-01 13:32:44 -04:00
policies Ensuring the same policies for analytics (#16997) 2022-03-25 14:57:01 -04:00
queries small non-views ruby i18n (#16004) 2022-01-11 10:05:18 +07:00
refinements Drop profile columns from user (#10707) 2020-12-03 08:14:38 +07:00
sanitizers Don't sanitize anchor elements with no href (#16667) 2022-02-22 11:27:38 -06:00
serializers Remove unused methods from User (#16616) 2022-02-18 09:02:17 +07:00
services Remove Feeds::Import's custom metric (#17075) 2022-03-31 16:41:27 -04:00
uploaders small non-views ruby i18n (#16004) 2022-01-11 10:05:18 +07:00
validators Remove the "Getting Started" Section from the Config (#16033) 2022-01-20 07:31:35 -07:00
view_objects Patching ERB rendering of the data-info JSON (#16067) 2022-01-14 08:30:49 -05:00
views Added a way to sort comments on an article (#16686) 2022-04-01 09:26:18 -05:00
workers Reducing subtle duplication of effort/logic (#17078) 2022-04-01 13:32:44 -04:00