Closed goulvench closed 8 years ago
Looks like activevalidators should be converting the postal code to a string before trying to validate it.
@goulvench Could you try replacing activevalidators in your Gemfile with this, and let me know if that fixes it?
gem 'activevalidators', github: 'penman/activevalidators', branch: 'numeric_postal_code'
Yes! Thank you, that works like a charm. My colleague told me to use strings instead for post codes in case we need to handle addresses outside of France, which would also solve that problem, but I believe your fix should be in the Gem nevertheless.
Great! When this issue is closed you can change your Gemfile back to normal.
Salut @goulvench,
Thanks for reporting it. @penman just fixed the issue and I just released a new version on Rubygems 1. Tell us if it's fixed for you.
Merci! Franck
Works great! Thanks @penman and @franckverrot for your quick response!
Hi,
I'm using ActiveValidator v4.0.0 in a project using Rails v5.0.0.1, ruby v2.3.1. I added the following to
config/application.rb
(inside theClass Application
block):But when I add
validates :delivery_address_postcode, postal_code: { country: :fr }
to my model and save data or run tests I get the following error:Any idea why that happens? Is there something else to configure?