Skip to content

General merit workflow

tute edited this page Nov 28, 2012 · 25 revisions

This is an explanation of how does merit process reputation starting from an HTTP request made to an endpoint with associated rules[1]. It's meant for merit developers, not directly helpful for application set up.

  1. Merit sets an application-wide after_filter, which creates a merit_action for the request if that controller/action pair has associated rules.

  2. Controller after_filter tells MeritAction class to process it's unprocessed activity (will typically be the newly created merit_action). It can be done synchronously (default) or as a background job.

  3. merit_action asks a judge to grant reputation, given the sash and rule in question.

  4. The judge will grant or remove badges and points from it's sash according to the rule[1].

[1] Reputation rules are set in the application via the DSL defined in files rules_{badge|points|rank}_methods.rb