docbrown/spec/lib
Daniel Uber 421dad2900
Remove reactions to a user when deleting the user (#15724)
* Remove reactions to a user when deleting the user

Fixes #15245

---

I have no idea why `create(:vomit_reaction, reactable: user)` gave a
validation error about category being invalid, but `build().save`
worked fine.

* Move relation details to reaction scope `for_user`

Add a user method to access this by passing self to reaction scope

* Create a moderator when flagging user in factory

This might be a missing requirement in the reactions factory - but
this suppresses an error about invalid category I was getting when
setting a privileged reaction on the user via

    create(:vomit_reaction, reactable: user)

Everywhere else it looks like we do this with `user: moderator` (where
there's a trusted user in the surrounding context).

* Move trusted user requirement into vomit_reaction factory

* Add a data update script to remove reactions to deleted users

This cleans up the remaining invalid references and should make the
change in #15249 obsolete (i.e. we don't need to limit the view to
exclude items that no longer exist).
2021-12-10 11:24:23 -06:00
..
acts_as_taggable_on Remove Elasticsearch ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ (#13606) 2021-05-03 11:09:45 -04:00
data_update_scripts Remove reactions to a user when deleting the user (#15724) 2021-12-10 11:24:23 -06:00
honeycomb [deploy] Optimization:Throttle Noisy Honeycomb Events More (#10143) 2020-09-01 15:21:07 -05:00
liquid Remove Liquid::BlockBody patch (#12313) 2021-01-18 08:09:28 +01:00
reverse_markdown/converters Preserve newlines and indentation in <pre> tags from RSS import (#10922) 2020-10-20 09:25:57 -04:00
sidekiq Abstract DatadogStatsClient to ForemStatsClient (#12304) 2021-01-27 11:25:44 -05:00
app_secrets_spec.rb [deploy] Feature: Setup Admin Area to Update Vault Secrets (#8935) 2020-06-29 15:08:09 -05:00
html_css_to_image_spec.rb Rename SiteConfig to Settings::General (#13573) 2021-05-21 14:45:37 +02:00
release_phase_notifier_spec.rb Notify slack when release phase fails (#6300) [deploy] 2020-02-27 10:50:59 -05:00
string_attribute_cleaner_spec.rb Refactoring to use StringAttributeCleaner (#15641) 2021-12-02 08:55:27 -05:00
throttled_call_spec.rb [15-minute fix] Add ThrottledCall to DisplayAdEventsController (#12924) 2021-03-09 09:06:11 +07:00
url_spec.rb Remove :runtime_banner feature flag (#13662) 2021-05-28 15:10:15 -06:00