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

Fix issues with allow_nil: true #997

Merged
merged 8 commits into from
Jul 21, 2022
Merged

Conversation

joemsak
Copy link
Contributor

@joemsak joemsak commented Jul 15, 2022

Turns out, the documentation I added in #995 wasn't 100% accurate. I had
to add tests for such examples and improve the internal code to support
the option. This should now provide the fully expected behavior.

@joemsak
Copy link
Contributor Author

joemsak commented Jul 15, 2022

@parndt I missed some necessary changes, this should resolve that.

raise_not_found_exception(id) unless allow_nil
raise_not_found_exception(id)
rescue => e
allow_nil ? nil : raise(e)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know we talked about exception control flow and I'm definitely not a fan, however I really am not aware of another strategy to use here. I'm open to suggestions though.

@joemsak
Copy link
Contributor Author

joemsak commented Jul 21, 2022

Dearest @parndt what is the likelihood of this getting merged and then a release? 🙏This PR satisfies the documentation. Let me know if you have feedback. Thanks!

@parndt
Copy link
Collaborator

parndt commented Jul 21, 2022

@joemsak I have been thinking about this change on and off all week! I've added a suggestion, let me know what you think

@parndt
Copy link
Collaborator

parndt commented Jul 21, 2022

I also spotted a duplicate raise which I've removed

Co-authored-by: Philip Arndt <git@p.arndt.io>
@joemsak
Copy link
Contributor Author

joemsak commented Jul 21, 2022

Thank you!

@parndt parndt merged commit bd3aab4 into norman:master Jul 21, 2022
@joemsak
Copy link
Contributor Author

joemsak commented Oct 7, 2022

Hey @parndt any chance on this making it to a release? Let me know your thoughts, thanks!

@parndt
Copy link
Collaborator

parndt commented Oct 10, 2022

@joemsak yes, definitely, I will get to it as soon as I can. 😄

@parndt
Copy link
Collaborator

parndt commented Nov 15, 2022

Version 5.5.0 pushed @joemsak

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