-
Notifications
You must be signed in to change notification settings - Fork 277
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
Add country search by numeric code #137
Conversation
There is one difficulty: user may pass numeric code as an integer to I've wrote handling code, that will accept numbers, but also will issue a warning, discouraging passing numbers. You can see it here: https://github.com/Envek/carmen/compare/numeric_code_search...handle_integer_numeric_code_searches?expand=1 I'm dislikes it in common, so, not sure, whether include it in this pull request or not. |
I think it's probably best to have multiple methods that search by a specific field instead of one that tries to handle all of the cases. Possibly, we should rename As far as handling a user passing an octal number accidentally, I think it's fine to not handle that case. Sometimes it is nice to help users do the right thing, but I think it's OK to expect them to understand the various numeric syntaxes in Ruby. |
So, I've added multiple methods that search by a specific field, but keep |
+1 |
This looks good. I will merge this before I release the next version. |
@cdainmiller Thoughts on this PR? I had some thoughts on this outlined in #170. |
@jim What should we do here? Still thinking this looks good for a release? I'm not sure, but maybe this is something we want to merge into a version-2.0 branch instead of master? |
Wow, this PR is already two years old and still mergeable! @jim, what do you think about it now? |
I think I intended to merge this a while ago. Sorry for the delay, @Envek. It's a small change to the existing API, and as several uses will find this useful, that's a good enough reason for me. |
This pull request extends #125 allowing not only access country's numeric code value but also allows to search countries by numeric code.