feat(member): replace can_log_in with derived active? and drop the column - #2785
Open
mroderick wants to merge 2 commits into
Open
feat(member): replace can_log_in with derived active? and drop the column#2785mroderick wants to merge 2 commits into
mroderick wants to merge 2 commits into
Conversation
mroderick
force-pushed
the
feature/can-log-in-derived
branch
from
August 5, 2026 14:29
94a000d to
03dcaee
Compare
mroderick
marked this pull request as ready for review
August 5, 2026 14:33
Replace the stored can_log_in boolean with a derived active? (an auth service exists), move the profile validation gates over to it, and remove the column. Members are active by having an auth service; the stored flag was misnamed and had corroded into a parity value. Follows the strong_migrations ignore-then-drop pattern.
Remove the can_log_in write from the OAuth callback (members are active by having an auth service) and only send members to the details page when they actually need additional details. A complete member who links a second provider now goes to the referer/dashboard instead of being bounced to profile completion. Closes the unconditional-redirect behaviour behind #2783.
mroderick
force-pushed
the
feature/can-log-in-derived
branch
from
August 5, 2026 14:37
03dcaee to
eb407ea
Compare
mroderick
marked this pull request as draft
August 5, 2026 14:38
mroderick
marked this pull request as ready for review
August 5, 2026 14:56
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.
Summary
Issue #2784. Replace the stored
members.can_log_inboolean with a derivedMember#active?and drop the column; stop writingcan_log_inin the OAuth callback and gate the details redirect onrequires_additional_details?.can_log_inwas never a login gate. Its only consumer,requires_additional_details?(app/models/member.rb), gates profile completion after login, and issue #2783 showed the value had degraded into a parity artifact across 116 members. A member is active by having an auth service, so the flag duplicates easily-derived truth — this removes the column and derives it.Key behaviours:
member.save!in the callback the just-builtauth_serviceis not yet persisted, soactive?(auth_services.exists?) is false; the member becomesactive?after save./member/details/edit— they go toreferer_or_dashboard_pathinstead. This closes the unconditional-redirect part of can_log_in is silently toggled off when a member links a second auth service — 115 members affected #2783.self.ignored_columns += ['can_log_in']precedes thesafety_assureddrop). No data repair is needed: the 116 affected members self-correct to active because they have auth services.Fixes #2784 · Resolves #2783
Base
Rebased onto
master. #2780 (OAuth race fix) is merged, so this PR contains only the #2784 work; no longer stacked on the race-fix branch.Verification
51 + 12RSpec examples pass (member, callback, controller, joining, ToC specs); rubocop clean.session[:referer_path]staleness (pre-existing).Post-Deploy Monitoring & Validation
members.can_log_in. Per the strong_migrations contract, ship the code containingignored_columnsin the same release as the migration.remove_columnis reversible (re-adds the column) but cannot restore dropped values; treat the column as obsolete (impact nil).NoMethodError/ undefined-column errors oncan_log_inin Rollbar (would indicate old code running against the dropped column — i.e. a missed two-phase deploy).Member#requires_additional_details?behaves as before for new-signup and second-provider flows.