* 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). |
||
|---|---|---|
| .. | ||
| acts_as_taggable_on | ||
| data_update_scripts | ||
| honeycomb | ||
| liquid | ||
| reverse_markdown/converters | ||
| sidekiq | ||
| app_secrets_spec.rb | ||
| html_css_to_image_spec.rb | ||
| release_phase_notifier_spec.rb | ||
| string_attribute_cleaner_spec.rb | ||
| throttled_call_spec.rb | ||
| url_spec.rb | ||