Skip to content

Raise NoSuchFieldError for missing sort and cursor fields - #52

Merged
dblock merged 1 commit into
mongoid:masterfrom
dblock:dblock/missing-cursor-field
Oct 15, 2026
Merged

dblock merged 1 commit into
mongoid:masterfrom
dblock:dblock/missing-cursor-field

Conversation

@dblock

@dblock dblock commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes #48.

Use the existing localized NoSuchFieldError when a criteria sort or saved cursor references a field no longer defined on the model. Validate plain and Base64 cursor objects, including decoded saved Base64 cursors, while preserving MismatchedSortFieldsError for differing existing fields and allowing nil values in defined fields.

Add regression coverage and document the error behavior.

Validation

Full RSpec suite (214 examples) and RuboCop for changed Ruby files pass. Full rake stops on two pre-existing Gemfile lint offenses (extra spacing and gem ordering); no unrelated lint changes included.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

Danger Report

No issues found.

View run

@dblock
dblock merged commit 58bdb2e into mongoid:master Oct 15, 2026
15 checks passed
@dblock
dblock deleted the dblock/missing-cursor-field branch October 15, 2026 12:18
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

Successfully merging this pull request may close these issues.

NoSuchFieldError is unused

1 participant