Skip to content

Commit

Permalink
Doc feature in README
Browse files Browse the repository at this point in the history
  • Loading branch information
sauloperez committed Nov 5, 2020
1 parent 4c64f52 commit 509ec8e
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down

0 comments on commit 509ec8e

Please sign in to comment.