rubyforgood / rubyforgood/awbw
Hide the per-item credit preference field from non-admins once profiles are self-service
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 15
- Forks
- 26
- Avg merge
- 12h 42m
- Merged PRs (30d)
- 242
Description
Interim state shipped in #2093.
Why the field is there now
Credits render from the credited person's profile (Person#display_name_preference plus anonymous_contributions). Facilitators cannot edit their own profile — PersonPolicy#edit? and #update? are admin? — so the submission forms still collect a per-item credit preference as a way to record what the submitter wants.
That stored value does not drive display. It surfaces on /author_credit_divergences as a discrepancy, and an admin applies it to the person's profile so it covers everything they share. The edit forms already warn when a record diverges, linking to that page.
What to do here
Once facilitators can edit their own display preferences:
- Hide
author_credit_preferenceon the three submitter-facing idea forms (story_ideas,workshop_ideas,workshop_variation_ideas) unlessallowed_to?(:manage?, ...)— the field lives inapp/views/shared/_author_credit_status.html.erb - Drop
:author_credit_preferencefrom those three controllers' strong params, or keep it admin-only - Point submitters at their own profile instead — replace the "an admin applies it to your profile" copy in
app/views/shared/_author_credit_preview.html.erb - Revisit whether the
preferencesection of the divergences page is still needed, or only the three sections about a missingauthor_id
Related
- Self-service profile editing is the blocker:
PersonPolicy#edit?/#update?are admin-only, andperson_paramspermitsnotes,filemaker_code,created_by_idand nesteduser_attributes[:inactive], so it needs its own narrow whitelist. - The per-item
anonymousoverride is a separate legacy path the divergences page also drains.
🤖 From Claude: filed while shipping the interim step in #2093.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading app/views/shared/_author_credit_status.html.erb and app/views/shared/_author_credit_preview.html.erb, then trace the three submitter-facing idea forms and their controllers. Confirm the self-service profile-editing prerequisite, restrict or remove the preference field and params, update the guidance, and determine whether the preference section remains on /author_credit_divergences.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rails, ruby
- Domain
- authorization, full-stack
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100