docs: update with notes about validity for zips#2963
Merged
stefannibrasil merged 3 commits intofaker-ruby:mainfrom Jun 11, 2024
Merged
docs: update with notes about validity for zips#2963stefannibrasil merged 3 commits intofaker-ruby:mainfrom
stefannibrasil merged 3 commits intofaker-ruby:mainfrom
Conversation
Contributor
stefannibrasil
left a comment
There was a problem hiding this comment.
thank you @garrettgregor ! Left two small suggestions.
doc/default/address.md
Outdated
Comment on lines
20
to
26
| #note: #zip_code will return a random string in zipcode format; may or may not be a valid US zip | ||
| Faker::Address.zip_code #=> "58517" or "23285-4905" | ||
|
|
||
| #note: #zip will return a random string in zipcode format; may or may not be a valid US zip | ||
| Faker::Address.zip #=> "58517" or "66259-8212" | ||
|
|
||
| #note: #postcode will return a random string in postcode format; may or may not be a valid US zip |
Contributor
There was a problem hiding this comment.
We generate zip codes for other countries, too.
Suggested change
| #note: #zip_code will return a random string in zipcode format; may or may not be a valid US zip | |
| Faker::Address.zip_code #=> "58517" or "23285-4905" | |
| #note: #zip will return a random string in zipcode format; may or may not be a valid US zip | |
| Faker::Address.zip #=> "58517" or "66259-8212" | |
| #note: #postcode will return a random string in postcode format; may or may not be a valid US zip | |
| #note: #zip_code will return a random string in zipcode format; may or may not be a valid zip | |
| Faker::Address.zip_code #=> "58517" or "23285-4905" | |
| #note: #zip will return a random string in zipcode format; may or may not be a valid zip | |
| Faker::Address.zip #=> "58517" or "66259-8212" | |
| #note: #postcode will return a random string in postcode format; may or may not be a valid zip |
Contributor
Author
There was a problem hiding this comment.
Does this accept something other than a US state? Will it adjust this per locale? If so maybe it would also be good to specify that this may or may not be a valid zip for the locale?
Contributor
There was a problem hiding this comment.
It will adjust per locale, yes. Saying that it may not be valid for the locale sounds good to me, thanks!
Contributor
Author
|
Updated with latest main and verbiage about locale instead of US zips. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation / Background
This Pull Request has been created because of issues I had run into whil previously trying to generate zip/postcode data. This came from a suggestion by @stefannibrasil 🙇🏻♂️ .
Additional information
Checklist
Before submitting the PR make sure the following are checked:
[Fix #issue-number]If you're proposing a new generator or locale: