hotfix: add missing SetupSurveyResponse model (NameError on login)#27
Open
pastoriniMatheus wants to merge 1 commit into
Open
hotfix: add missing SetupSurveyResponse model (NameError on login)#27pastoriniMatheus wants to merge 1 commit into
pastoriniMatheus wants to merge 1 commit into
Conversation
User model declares has_one :setup_survey_response but the model file was missing, causing NameError when the auth service tried to serialize the user after login. Added the model class with belongs_to :user. File: app/models/setup_survey_response.rb (3 lines, new)
Reviewer's guide (collapsed on small PRs)Reviewer's GuideIntroduces the missing SetupSurveyResponse ActiveRecord model to satisfy an existing has_one association on User and prevent a NameError during login. File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This was referenced May 15, 2026
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.
Resumo
Hotfix extraído da PR #22 (que misturava 3 escopos). O model
SetupSurveyResponsenão existia mas era referenciado porUser.has_one :setup_survey_response, causandoNameErrorno login.Causa raiz
app/models/user.rbdeclarahas_one :setup_survey_response, dependent: :destroy(linha 81) esetup_survey_completed?(linha 83-85) que acessa a associação. Sem o model file, o Rails levantaNameError: Missing model class SetupSurveyResponsequando tenta serializar o usuário após login.Correção
Arquivo:
app/models/setup_survey_response.rb(3 linhas, novo)Contexto do split
PR #22 carregava 3 escopos não relacionados:
Plano de testes
setup_survey_completed?retorna false para usuários sem surveySummary by Sourcery
New Features: