Skip to content

Show unconfirmed facilitators in story author dropdown#1551

Draft
maebeale wants to merge 1 commit into
mainfrom
maebeale/1515-unconfirmed-author-dropdown
Draft

Show unconfirmed facilitators in story author dropdown#1551
maebeale wants to merge 1 commit into
mainfrom
maebeale/1515-unconfirmed-author-dropdown

Conversation

@maebeale
Copy link
Copy Markdown
Collaborator

@maebeale maebeale commented Jun 5, 2026

Closes #1515

What is the goal of this PR and why is this important?

  • Facilitators with unconfirmed emails were silently missing from the story author dropdown (confirmed examples: Courtney Koczka, Lemny Perez).
  • Email confirmation status should not gate whether a facilitator can be credited as a story author — they are real people who do the work regardless of whether they've confirmed their email.

How did you approach the change?

  • The dropdown was built from User.has_access, which requires confirmed_at to be present — that's the gate that hid these facilitators.
  • Added a dedicated User.selectable_as_author scope: active + unlocked, without the email-confirmation requirement.
  • Switched the story form's author collection (set_form_variables) to use selectable_as_author.
  • Left has_access untouched so its access-control semantics (used broadly elsewhere) are unchanged.

Anything else to add?

  • The same has_access-based author dropdown exists for story ideas (story_ideas_controller) and a few other forms (workshop ideas, bookmarks, etc.). Those were intentionally left out of scope since the issue is specifically about the story author dropdown — happy to extend selectable_as_author to them in a follow-up if the same treatment is wanted.
  • Tested via a model spec for the new scope (includes confirmed + unconfirmed, excludes inactive/locked). A request spec for GET /stories/new was not added because full-page renders 500 in the test environment (asset/vite related, pre-existing) — existing story request specs only exercise Turbo-frame/redirect paths for the same reason.

🤖 Generated with Claude Code

Email confirmation status should not determine whether a facilitator can
be credited as a story author — they are real people who do the work
regardless of whether they have confirmed their email. The dropdown was
built from `User.has_access`, which gates on `confirmed_at`, silently
hiding facilitators like Courtney Koczka and Lemny Perez.

Introduce a dedicated `selectable_as_author` scope (active + unlocked,
no confirmation requirement) and use it for the story form's author
collection, leaving the access-control semantics of `has_access` intact.

Closes #1515

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 5, 2026 00:43
Comment thread app/models/user.rb
# Users selectable as a story/idea author. Unlike has_access, email confirmation
# is not required: facilitators are real people who should be creditable
# regardless of whether they have confirmed their email.
scope :selectable_as_author, -> { where(locked_at: nil, inactive: [ false, nil ]) }
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deliberately a separate scope rather than relaxing has_access: has_access is the access-control gate used across the app (auth, search, remote search), and it should keep requiring email confirmation. Authorship is a weaker notion — we only need the person to be a real, active facilitator — so confirmation is dropped here only.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the story author dropdown so that facilitators with unconfirmed emails are still selectable as authors, by decoupling “selectable as author” from the broader has_access (confirmed-email-gated) scope.

Changes:

  • Added User.selectable_as_author scope (active + unlocked, no email confirmation requirement).
  • Updated StoriesController#set_form_variables to build the author dropdown from selectable_as_author instead of has_access.
  • Added model specs covering confirmed/unconfirmed inclusion and inactive/locked exclusion.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
spec/models/user_spec.rb Adds coverage for the new selectable_as_author scope behavior.
app/models/user.rb Introduces the new selectable_as_author scope and documents how it differs from has_access.
app/controllers/stories_controller.rb Switches the story form’s author collection to use the new scope.

Comment thread app/models/user.rb
Comment on lines 84 to +88
scope :has_access, -> { where(locked_at: nil, inactive: [ false, nil ]).where.not(confirmed_at: nil) }
# Users selectable as a story/idea author. Unlike has_access, email confirmation
# is not required: facilitators are real people who should be creditable
# regardless of whether they have confirmed their email.
scope :selectable_as_author, -> { where(locked_at: nil, inactive: [ false, nil ]) }
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.

New story: facilitators with unconfirmed emails missing from author dropdown

2 participants