Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RecordNotFound after rake db:reset #7

Open
smudge opened this issue Jan 30, 2023 · 0 comments
Open

RecordNotFound after rake db:reset #7

smudge opened this issue Jan 30, 2023 · 0 comments

Comments

@smudge
Copy link
Member

smudge commented Jan 30, 2023

When running with demo mode enabled in local development, running rake db:reset will clear out any existing DemoMode::Session record. This can cause the application to break due to an ActiveRecord::RecordNotFound error triggered by one of the controller before_actions. Instead of raising a hard error, we could probably force a logout instead. We'd just need to think about whether this wouldn't mask real lookup issues.

smudge pushed a commit that referenced this issue Jul 10, 2024
…27)

This addresses issue #7.

- Changes `Session.find` to `Session.find_by` in
`DemoMode::Demoable#current_demo_session` to prevent a Not Found
exception when the session is no longer in the database, e.g., after
resetting the database.
- Checks that the `current_demo_session` is not `nil` in
`DemoMode::Demoable#demo_splash!`.
- Adds a system spec for this scenario
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

No branches or pull requests

1 participant