hackclub / hackclub/theseus

web controller doesn't record paper_trail whodunnit

Open
#241 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
24
Forks
18
Avg merge
7h 11m
Merged PRs (30d)
7

Description

the web `ApplicationController` sets `PaperTrail.request.controller_info` (IP) but never sets `PaperTrail.request.whodunnit` or includes `PaperTrail::Rails::Controller`. the API controller does both correctly.

this means every mutation made through the web UI has a blank `whodunnit` in the versions table — we can't tell who did what.

found this while investigating an order edit on `pkg!6pnt96nw` for AGH Fulfillment — someone changed line items on a dispatched order through the web UI and we couldn't identify who because whodunnit was nil.

**fix:** either `include PaperTrail::Rails::Controller` in `ApplicationController` (which auto-sets whodunnit from `current_user`) or manually set `PaperTrail.request.whodunnit = current_user&.id` in `set_paper_trail_info`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.