Show unconfirmed facilitators in story author dropdown#1551
Draft
maebeale wants to merge 1 commit into
Draft
Conversation
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>
maebeale
commented
Jun 5, 2026
| # 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 ]) } |
Collaborator
Author
There was a problem hiding this comment.
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.
Contributor
There was a problem hiding this comment.
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_authorscope (active + unlocked, no email confirmation requirement). - Updated
StoriesController#set_form_variablesto build the author dropdown fromselectable_as_authorinstead ofhas_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 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 ]) } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1515
What is the goal of this PR and why is this important?
How did you approach the change?
User.has_access, which requiresconfirmed_atto be present — that's the gate that hid these facilitators.User.selectable_as_authorscope: active + unlocked, without the email-confirmation requirement.set_form_variables) to useselectable_as_author.has_accessuntouched so its access-control semantics (used broadly elsewhere) are unchanged.Anything else to add?
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 extendselectable_as_authorto them in a follow-up if the same treatment is wanted.GET /stories/newwas 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