Phase 1: multi-tenant fleet core#4
Merged
Merged
Conversation
- Rails 8 native authentication plus signup flow (Registration form object creates the Account and its first admin user in one transaction) - Row-level multi-tenancy: every domain record belongs to an Account and is only reachable through Current.account associations - Pundit role policies: viewer (read-only), manager, admin - Vehicles CRUD with VIN normalization/validation, search + status filters (Stimulus autosubmit), Pagy pagination, and background VIN decoding via the free NHTSA vPIC API (never overwrites user-entered data) - Drivers CRUD with license expiry tracking - Assignments with overlap validation per vehicle and per driver, and cross-account integrity checks - Tailwind UI: app shell, tables, forms, empty states - 73 specs: models, policies, requests (tenant isolation, authorization), service with WebMock, job, and 2 end-to-end system specs Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The stock bin/dev installs foreman as a global gem, which fails on this machine (root-owned rbenv installs to a non-PATH user dir). foreman now lives in the Gemfile and bin/dev invokes it with bundle exec. Logged in docs/POSTMORTEMS.md. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
Implements the fleet management core on top of the Phase 0 foundations:
Registrationform object creates theAccountand its first admin user in a single transaction.account_id. Controllers only reach data throughCurrent.accountassociations;Assignmentadditionally validates that vehicle and driver belong to the same account. Request specs assert cross-tenant access returns 404.viewer(read-only),manager(fleet CRUD),admin.VinDecoderservice +VinDecodeJob; user-entered data is never overwritten).Test plan
db:seedproduces a demo account (admin@fleetpilot.test/password123)🤖 Generated with Claude Code