Common Tasks
Each line gives the short answer and links to the section that covers it. If your question isn’t here, the docs index lists every page.
I want to…
- Add a model that belongs to a workspace. Generate it with a
workspacereference, load it through@workspacein the controller and authorize it with a policy. Adding a workspace-scoped feature - Write a job that works on one workspace. Pass the workspace’s id, set
Current.workspaceinsideperform, and read it back withCurrent.workspace!. Outside the request cycle - Email every member of a workspace. Use a notifier, not a mailer of your own. A notifier respects each member’s notification preferences and the digest, and its mailer skips suspended users. A job that emails a workspace’s members
- Check accessibility before I push. The axe audit runs after every system spec, in both themes. The hook won’t run the system spec for a page whose view you changed, so run that spec yourself, or write one if none visits the page. Check accessibility on the page you changed
- Run only the specs my branch can break. Run
bin/test-plan --run. This is what the pre-push hook runs. Change lanes - Run the whole suite. Run
bin/parallel-rspec. Three ways to run the suite - Get my change to users. Merge your pull request into
next. A release carries it to staging, then to production. How your code reaches users - Add a recurring job. Adding a recurring job
- Add a docs page of my own to a fork. Adding your own docs page
- Take the template’s updates into my fork. Pull upstream updates
- Back up the production database. Back up the database
Something went wrong
git pushwas refused. Lefthook’s summary marks the failed check with 🥊. Rerun it withbundle exec lefthook run pre-push --job <name>, fix the cause and push again. When a push is refused- Tests on
nextwent red after my merge. If it’s a flaky test, re-run the failed jobs. If it’s a real failure, merge a fix. A release waits until CI passes onnext. When a release starts - An invitation or sign-in email didn’t arrive. Why didn’t my invitation arrive?
- Production sends no mail. Configure outbound mail
- A Stimulus controller does nothing. Stimulus controller silently fails to register
db/schema.rbhas changes my branch didn’t make. Schema changes you didn’t make- “Another process is holding the test database.” Another process is holding the test database