{"record":{"id":"b9512af96b0da4cb","repo":"we-promise/sure","slug":"record-not-found-b9512a","errorCode":"record_not_found","errorMessage":"The requested resource was not found","messagePattern":"The requested resource was not found","errorType":"http","errorClass":"ActiveRecord::RecordNotFound","httpStatus":404,"severity":"error","filePath":"app/controllers/api/v1/transfers_controller.rb","lineNumber":32,"sourceCode":"    @pagy, @transfers = pagy(\n      transfers_query,\n      page: safe_page_param,\n      limit: @per_page\n    )\n\n    render :index\n  rescue Api::V1::TransferDecisionFiltering::InvalidFilterError => e\n    render_validation_error(e.message)\n  end\n\n  def show\n    render :show\n  end\n\n  private\n\n    def set_transfer\n      raise ActiveRecord::RecordNotFound unless valid_uuid?(params[:id])\n\n      @transfer = transfers_scope.find(params[:id])\n    end\n\n    def transfers_scope\n      transfer_decision_scope(Transfer)\n    end\nend\n","sourceCodeStart":14,"sourceCodeEnd":41,"githubUrl":"https://github.com/we-promise/sure/blob/e69894adb92547273377398c15f45c979cd9416a/app/controllers/api/v1/transfers_controller.rb#L14-L41","documentation":"Raised by set_transfer in Api::V1::TransfersController (app/controllers/api/v1/transfers_controller.rb:32). The valid_uuid? guard rejects malformed ids with ActiveRecord::RecordNotFound; otherwise transfers_scope (transfer_decision_scope(Transfer), family-scoped with the shared decision filtering) must find the row. Result is 404 record_not_found.","triggerScenarios":"GET /api/v1/transfers/:id with a non-UUID; a transfer id belonging to another family; an id taken from the rejected_transfers collection (a RejectedTransfer, not a Transfer).","commonSituations":"Cross-collection id confusion between /transfers and /rejected_transfers; multi-family API key mix-ups; transfers consolidated or removed after review.","solutions":["List with GET /api/v1/transfers and use an id from that collection","Do not reuse ids across /transfers and /rejected_transfers","Validate UUID format before the call","Treat 404 as resolved/gone and re-list"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"UUID_RE = /\\A[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\z/i\nUUID_RE.match?(id) or raise ArgumentError, 'transfer id must be a UUID'","typeGuard":null,"tryCatchPattern":"begin\n  client.get(\"/api/v1/transfers/#{id}\")\nrescue Faraday::ResourceNotFound\n  # 404: not a Transfer in this family's decision scope\nend","preventionTips":["Source ids from GET /api/v1/transfers only","Keep transfer and rejected-transfer id pools separate","Re-list after review/consolidation actions"],"tags":["rails","activerecord","record-not-found","http-404","uuid","api"],"backgroundTag":"record-not-found","analyzedSha":"e69894adb92547273377398c15f45c979cd9416a","analyzedAt":"2026-08-21T18:22:41.165Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}