All notable changes to this project will be documented in this file.
- Pass
format: true
option to thevalidates_zipcode
or the constructor to attempt for format a given code using the (uncomplete) list of formatters by country. This process will happen before the validation takes place, dealing with case sensitive formats and whitespace, amongst others. This option is false by default for backwards compatibility. ~ @chloe-meister - Fixed unconsistent behaviour by which the
ValidatesZipcode.format
andValidatesZipcode::Formatter.new(..).format
where formatting an invalid code, the former, and raising a validity error, the latter. ~ @chloe-meister
HEADS UP: While I don't think this update would break any system for anyone, many formats where revisited to make them more loose or strict, potentially rendering your data invalid, particularly in edge cases or with data that was already incorrect in the first place and not flagges as such. I recommend you check your data with the new version in case these validations are critical to you. I am not releasing this as a 1.0 because there are no breaking changes in the API though. See PR #54 for more details.
- Many regexps where modified to include recent changes in postal services, fix issues, narrow down formats that where unnecessary broad, allow for some looser cases such as optional whitespaces and making many of them case insensitive and removing countries with no postal codes - See PR #54. Thanks to ~ @ojsdude with some help from @dgilperez
- Allow the gem to generate test data from the formatters. See README ~ @ojsdude
- Officially support Ruby 3 and Rails 6.1
- Fixes AR regex
- Adds formatter for CA ~ @devthiago
- Removes forbidden combinations in the Netherlands ~ @gerard76
- Adds zipcode formatting feature ~ @aiomaster
- Drops support for EoL Rails < 4.2 and Ruby < 2.4. ~ @dgilperez
- Allows for a custom message passed to the validator ~ @andychongyz
- Fixes LV postal code format
- Fixes MU postal code format ~ @thrasherDGK
- Fixes LT postal code format ~ @tmeckhoff
- Fixes NI postal code format ~ Daniel Olivares
- Dropped support for Rails 3.2, 4.0, 4.1 and Ruby 1.9.3 and Ruby less than Ruby 2.3. This means those versions or combinations may still work for you, but they will not be tested nor receive support.
- Added support for Rails 6.0. Yeehaw!
- Support for Taiwan 5-digit codes, thanks to ~ @ThomasChiesa
- Relaxes UK / GB regex to support codes without whitespace. Fixes backward compatibility breaking in 0.0.20. ~ Thanks to @tom-lord
- Dropped support for Rails 4.0 and 4.1 and for older minor Ruby 2 versions. This means those versions or combinations will not be tested, they may still work but will not receive support. This change could potentially break some apps in the future. Also, gem is stable enough to merit a minor version. Hence, 0.1.0 is here.
- Added support for Rails 5.1 and 5.2 ~ @Onumis
- Merge UK and GB regex, using official regex provided by gob.uk. Breaks compatibility for codes without whitespace ~ @Onumis @dgilperez
- Fixes JP and IE formats, thanks to ~ @timokleemann
- Adds support for
excluded_country_codes
in the validation setup. - Remove support for UAE, not reliable sources found, assume not used.
- Updates support for Luxembourg postal codes ~ @rivsc
- Support for old / new Israel postal codes ~ @EricLarch
- Support for old / new Lithuania postal codes ~ @EricLarch
- Support for Rails5 ~ @dgilperez
- Support for new Korea postal codes ~ @adlersantos
- Sweden whitespace made optional ~ @radubatori
- Fix Brazil zipcode ~ @pedrosfdcarneiro
- Support zip+6 for the USA ~ @dimroc
- Added Code of Conduct from Contributor Covenant ~ @dgilperez
- Fixed Regex for Greece thanks to @Masa331
- Added ValidatesZipcode.valid?(zipcode, country_alpha2) for usage outside models ~ @dgilperez