Skip to content

Remove dead agency_id column from users (completes #414) - #2307

Draft
maebeale wants to merge 1 commit into
mainfrom
maebeale/remove-users-agency-id
Draft

Remove dead agency_id column from users (completes #414)#2307
maebeale wants to merge 1 commit into
mainfrom
maebeale/remove-users-agency-id

Conversation

@maebeale

Copy link
Copy Markdown
Collaborator

🤖 suggested review level: 3 Read 📖 drops an unused column + FK + index and cuts over two legacy readers; behavior-preserving

Why

What

  • Migration drops the FK, index, and column. Reversible up/down, both idempotent and rollback-tested.
  • workshops_controller#summary passed current_user.agency_id as the org filter into organization_workshop_logs. Since that value is always NULL in prod, the method already returns nil; swapped to an explicit nil — identical behavior, no column dependency.
  • users_controller dropped :agency_id from the legacy permitted-params list.
  • Removed a stale commented reference in the users factory.

Notes for reviewer

  • Pre-existing oddity left untouched: summary does authorize! @combined_workshop_logs, which is authorize! nil whenever the combined logs are empty (i.e. always, in prod). Not introduced here — flagging as a possible follow-up.

Closes #414

Legacy FK carried from the old schema; prod holds no values. Its only live
readers were a vestigial call in the workshops summary (passed a
now-always-nil org filter — swapped for an explicit nil, behavior unchanged)
and a legacy permitted param. Completes #414 (affiliations half shipped in
#2305).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove agency_id foreign keys

1 participant