Skip to content

Commit 7d14d42

Browse files
docs: update with notes about validity for zips (#2963)
* docs: update with notes about validity for zips * update with locale
1 parent 88283de commit 7d14d42

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

doc/default/address.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@ Faker::Address.mail_box #=> "PO Box 123"
1717

1818
Faker::Address.community #=> "University Crossing"
1919

20+
#note: #zip_code will return a random string in zipcode format; may or may not be a valid zip for locale
2021
Faker::Address.zip_code #=> "58517" or "23285-4905"
2122

23+
#note: #zip will return a random string in zipcode format; may or may not be a valid zip for locale
2224
Faker::Address.zip #=> "58517" or "66259-8212"
2325

26+
#note: #postcode will return a random string in postcode format; may or may not be a valid zip for locale
2427
Faker::Address.postcode #=> "76032-4907" or "58517"
2528

2629
Faker::Address.time_zone #=> "Asia/Yakutsk"

lib/faker/default/address.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ def zip_code(state_abbreviation: '')
119119
return numerify(letterified_string, leading_zero: true)
120120
end
121121

122-
# provide a zip code that is valid for the state provided
123-
# see http://www.fincen.gov/forms/files/us_state_territory_zip_codes.pdf
122+
# provide a zip code that may be valid for the state provided
123+
# note: zip code may appear in the correct format for the state provided but may not be an actual state zip.
124124
bothify(fetch("address.postcode_by_state.#{state_abbreviation}"))
125125
end
126126

0 commit comments

Comments
 (0)