diff --git a/README.md b/README.md index 01d21fcb..02686ddb 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,33 @@ TWILIO_AUTH_TOKEN # Token from your Twilio account SMS_SENDER # Twilio's phone number. You need to purchase one there with SMS capability. ``` +### Track delegated votes and unvotes + +Votes and revocations done on behalf of other members are tracked through the +`versions` table using `PaperTrail`. This enables fetching a log of actions +involving a particular delegation or consultation for auditing purposes. This +keeps out regular votes and unvotes. + +When performing votes and unvotes of delegations you'll see things like the +following in your `versions` table: + +```sql + id | item_type | item_id | event | whodunnit | decidim_action_delegator_delegation_id +------+------------------------------+---------+---------+-----------+---------------------------------------- + 2019 | Decidim::Consultations::Vote | 143 | destroy | 1 | 22 + 2018 | Decidim::Consultations::Vote | 143 | create | 1 | 22 + 2017 | Decidim::Consultations::Vote | 142 | create | 1 | 23 + 2016 | Decidim::Consultations::Vote | 138 | destroy | 1 | 23 +``` + +Note that the `item_type` is `Decidim::Consultations::Vote` and `whoddunit` +refers to a `Decidim::User` record. This enables joining `versions` and +`decidim_users` tables although this doesn't follow Decidim's convention of +using gids, such as `gid://decidim/Decidim::User/1`. + +You can use `Decidim::ActionDelegato::DelegatedVotes::Versions` query object for +that matter. + ## Contributing See [Decidim](https://github.com/decidim/decidim).