docbrown/spec
Daniel Uber 16d17445a5
reenable article rescoring when moderators flag users (#12983)
* Update worker calculation and disable early return

* Enable service tests

This updates the test to look at the individual article scores
changing, rather than the sum of the articles scores changing

The scores lambda was added as a way to observe this eagerly

* Correctly handle raising the score when vomit is cleared

The initial implementation loaded the articles reactions and the
user's reactions in order to rescore. This restores that activity.

It occurs to me that article.reactions.sum(:points) +
user.reactions.sum(:points) feels like something articles should know
how to do, in which case we can move this into article (#rescore!)?
and call that instead of knowing how to handle moderation specially here.

* Move logic to Article#update_score

Having realized "sum of reaction scores" was an Article concern, I
found that we have a worker to score articles that does _exactly_ what
we're doing here.

Let's use that and allow the vomit reaction presence or absence on a
user to automatically affect the article calculations.

This is at least n + 1 and maybe worse.
2021-03-16 14:04:13 -05:00
..
black_box Routine rubocop fixes (#10237) 2020-09-08 12:06:47 -04:00
decorators Improve cumulative layout shift on comment reactions + optimizations (#12309) 2021-01-18 19:29:44 -05:00
factories Add mobile push notifications to Forem (#12419) 2021-03-12 14:08:18 -06:00
fixtures Deployment Task: Update onboarding fields prior to #11629 (#11704) 2020-12-07 14:57:18 -05:00
generator Add service generator (#11265) 2020-11-10 09:09:35 +07:00
helpers [15 Minute Fix]: Update email footer copy to account for email authentication (#12877) 2021-03-03 08:36:40 -08:00
initializers Fix regression in Honeybadger.config.exceptions.ignore (#12796) 2021-02-23 19:08:29 +01:00
lib [15-minute fix] Add ThrottledCall to DisplayAdEventsController (#12924) 2021-03-09 09:06:11 +07:00
liquid_tags improve keyboard accessibility of modals 12427 10610 (#12511) 2021-02-24 16:01:10 +00:00
mailers Email confirmation to abuse reports (#12557) 2021-02-03 22:59:50 +03:00
models Limit mentions in comments (#12923) 2021-03-10 11:23:11 -08:00
policies Prevent banned users from using API (#12730) 2021-02-18 17:56:16 -05:00
queries/admin Add all new functionality for trusted (#10816) 2020-10-15 17:00:49 -04:00
refinements Update data exporter to handle admin send (#10274) 2020-10-26 18:00:56 -04:00
requests Add test for DevicesController (#12985) 2021-03-16 08:33:25 -05:00
routing Add mobile push notifications to Forem (#12419) 2021-03-12 14:08:18 -06:00
serializers/search [deploy] Refactor:Remove Reaction Search Code (#10377) 2020-09-23 12:27:50 -05:00
services reenable article rescoring when moderators flag users (#12983) 2021-03-16 14:04:13 -05:00
support [15-minute fix] Add ThrottledCall to DisplayAdEventsController (#12924) 2021-03-09 09:06:11 +07:00
system Add rate limit for new user comments (#12925) 2021-03-16 08:39:31 +07:00
tasks Refactor:Send Welcome Broadcast Notifications From Sidekiq (#9923) 2020-08-21 12:57:08 -04:00
uploaders Bump carrierwave from 2.1.1 to 2.2.0 (#12802) 2021-02-25 10:53:25 +01:00
view_objects Enable Rubocop 0.89 cops and fix Lint/ violations (#9709) 2020-08-10 16:57:12 +02:00
views Update the UI for Low-Quality-Comments Notice (#12952) 2021-03-16 09:40:29 -04:00
workers [15-minute fix] Add ThrottledCall to DisplayAdEventsController (#12924) 2021-03-09 09:06:11 +07:00
rails_helper.rb Bump rubocop from 1.10.0 to 1.11.0 (#12848) 2021-03-01 14:34:13 +00:00
spec_helper.rb Manually load dotenv in test (#9971) 2020-08-24 20:19:03 +02:00