-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Coerce empty string to nil for all Primitive types except String #2067
Conversation
dce69ac
to
6df96a0
Compare
This matches the behavior in v1.2.5 with the exception of Symbol. In v1.2.5 an empty string was coerced to an empty symbol (:''), now it is coerced to nil.
6df96a0
to
66f4e38
Compare
Here's a reproduction of the behavior on v.1.2.5: petekinnecom@ec99d8c#diff-d4c132540f49911bbd1c73264c2c738bR12 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks right to me 👍
This does modify external behavior of interacting with an API. I think we need:
WDYT? |
@dblock do you mean more integration tests? What is wrong with unit tests? 🤔 Personally, I like more unit tests, they are more focused (point to code under tests). |
Yes. This behavior affects what happens when you call an API, and there are no changes in tests for that external behavior. We often rely on those integration tests when we're not sure what's supposed to happen and still keep introducing regressions. Better safe than sorry. @petekinnecom if you aren't adding any I'm OK with merging this though. Just let us know? |
These specs mirror the specs for nil params. Exceptions are made for non-primitive types based on their current behavior.
I've pushed a commit that has integration tests that mirror the tests found for 619db09#diff-d4c132540f49911bbd1c73264c2c738bR533 |
Perfect, merged. Thank you. |
No description provided.