8000 Fix bug caused by not returning accumulator if presence isn't included in the validation definition by MatthewRDodds · Pull Request #16 · rewinfrey/ActionLogic · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix bug caused by not returning accumulator if presence isn't included in the validation definition #16

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

Merged

Conversation

MatthewRDodds
Copy link
@MatthewRDodds MatthewRDodds commented Jun 6, 2022

Overview

When some validations include the presence key and others do not, this error is raised:

NoMethodError:
       undefined method `<<' for nil:NilClass

It's because the accumulator is not returned for those validation expectations that don't include the presence key. So in the iteration following such a definition, error_collection is nil.

@MatthewRDodds
Copy link
Author

I think this fix was applied previously: #12

But it appears to have been lost during a later refactoring.

Copy link
Owner
@rewinfrey rewinfrey left a comment

Choose a reason for hiding this comment

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

@MatthewRDodds thank you for the patch! ❤️ Nice find and debugging. I'm not sure what happened, but you're right the fix was dropped somehow. I must have cut a bad release and dropped it by accident. If you're okay with the suggestion I'm happy to merge.

@rewinfrey rewinfrey mentioned this pull request Jun 7, 2022
@rewinfrey rewinfrey merged commit 41a0fad into 66CB rewinfrey:master Jun 9, 2022
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
0