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

return nil for relationships that exist but are empty #11

Merged
merged 1 commit into from
Mar 7, 2022

Conversation

cisacke
Copy link
Contributor

@cisacke cisacke commented Mar 2, 2022

in cases where a relationship is possible (e.g. an ApplicationForm can have an Application) but it doesn't exist for a specific instance, we should just return nil when trying to access that relationship (e.g. application_form.application should just return nil if there isn't an Application, instead of throwing an error), which is the behavior with ActiveRecord

@cisacke cisacke requested a review from ianyamey March 2, 2022 14:25
@cisacke cisacke merged commit 45cd96f into main Mar 7, 2022
@cisacke cisacke deleted the chloe__handle-empty-relationships branch April 12, 2022 17:31
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.

2 participants