yolk / valvat

Validates european vat numbers. Standalone or as a ActiveModel validator.
MIT License
318 stars 80 forks source link

undefined method `exists?' for #<Valvat XXX> #86

Closed markovanderpuil closed 3 years ago

markovanderpuil commented 3 years ago

valvat (0.9.1) lib/active_model/validations/valvat_validator.rb:46:in `vat_exists?'

What I'm trying to accomplish is this:

So EU countries are matched and lookupped and other countries are allowed as well without lookup

validates :taxid, valvat: {match_country: :country, lookup: true, allow_blank: true, if: :eu?}

yolk commented 3 years ago

First: Thanks for the report!

This is very strange and I am not able to reproduce the problem.

Could you post the complete stack trace? What versions of activerecord and ruby are you using?

martinbarilik commented 2 years ago

this error occurs when using ", require: 'valvat/local'" in gemfile as

gem 'valvat', require: 'valvat/local'

removing require clause will remove the error ... Made me scratch my head for some time.