* 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). |
||
|---|---|---|
| .. | ||
| data_update_scripts | ||
| generators | ||
| liquid | ||
| omni_auth/strategies | ||
| sidekiq | ||
| sitemap_generator | ||
| slack/notifier/util | ||
| tasks | ||