Conversation
Test coverage93.59% line coverage reported by SimpleCov. |
DNR500
force-pushed
the
create-and-get-ownership-transfer
branch
from
September 15, 2026 14:24
5db3b80 to
3acb88c
Compare
| response | ||
| rescue StandardError => e | ||
| Sentry.capture_exception(e) | ||
| response[:error] = "Error creating ownership transfer: #{e}" |
DNR500
force-pushed
the
create-and-get-ownership-transfer
branch
from
September 15, 2026 15:46
3acb88c to
44c8217
Compare
DNR500
force-pushed
the
create-and-get-ownership-transfer
branch
from
September 15, 2026 17:09
44c8217 to
69a8eed
Compare
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 WIP
Backend for #1767 / #1770.
Built on top of #1019 (
nominated_user_id/requested_by_user_id/statusschema forownership_transfers), which lays the data model but doesn't add any endpoint yet. This PR should be rebased ontomainonce #1019 merges — as the base branch #1019 develops it will mainly be concerned with the endpoint to start a transfer, so this PR is scoped to the get/read endpoint that provides the status of a transfer.Adds the endpoint
editor-standaloneneeds to show ownership transfer status to both the owner and the nominee.What's changed?
GET /api/schools/:school_id/ownership_transfer— returns who the current user is relative to the pending transfer; anyone not involved gets a 404, same as if no transfer existedownership_transfers.school_id(scoped tostatus = 'pending') plus a matching model validation, so two concurrent requests can't both succeednominated_user_idnever had a role anywhere, socreate(:ownership_transfer)always failed validation)Examples
Checking transfer status
As the owner who requested it, while it's pending:
As the nominee, while it's pending:
The transfer stays visible to the requester and nominee after it's resolved —
statusreflects whatever actually happened, rather than the response disappearing once it's no longer pending:As anyone else at the school (a different teacher, a different owner who wasn't involved, or if no transfer has ever existed for the school) — deliberately indistinguishable, so the response doesn't leak whether one exists or what happened to it:
(empty body)
Other responses:
401(no token),403(caller has no role at that school at all).