Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MONGOID-5789 Allow nil attribute access (backport of #5836) #5838

Merged
merged 2 commits into from
Jul 15, 2024

Conversation

jamis
Copy link
Contributor

@jamis jamis commented Jul 12, 2024

Allow nil attribute access (returning nil instead of raising an obscure exception). See #5836.

…se UnknownAttribute exception (mongodb#5836)

* database_field_name given nil or empty string should raise UnknownAttribute exception

* fix spec syntax

* database_field_name return empty string instead of exception

* `field` might be an empty string, not merely nil

* fix specs to expect empty string instead of nil

This is okay, because the database_field_name method is a private API.
We can change the contract here without regard for who else might
be using it.

---------

Co-authored-by: Jamis Buck <[email protected]>
@jamis
Copy link
Contributor Author

jamis commented Jul 12, 2024

The evergreen failures are due to rockylinux8 not being a fully-compatible replacement for rhel80 (and we can't use rhel80 because we're running the tests in docker, and there is no docker image available for rhel80). I've created a ticket to discuss and address this: https://jira.mongodb.org/browse/MONGOID-5795.

The GH action failures are almost certainly due to this: actions/runner-images#10215

@jamis jamis merged commit e128665 into mongodb:8.1-stable Jul 15, 2024
29 of 65 checks passed
@jamis jamis deleted the 5789-nil_attribute_access-8.1-stable branch July 15, 2024 23:01
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.

3 participants