Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArgumentError: Unknown validator: 'BicValidator' #4

Open
Kosmas opened this issue Nov 12, 2013 · 3 comments
Open

ArgumentError: Unknown validator: 'BicValidator' #4

Kosmas opened this issue Nov 12, 2013 · 3 comments

Comments

@Kosmas
Copy link

Kosmas commented Nov 12, 2013

Trying to use the gem in a model with a BIC field called encrypted_BIC results in :

ArgumentError: Unknown validator: 'BicValidator'

after installing the gem and following the installations instructions.

the model has the following:

class ModelName < ActiveRecord::Base
...
validates :encrypted_BIC, bic: true
...
end

and when trying in the console to do:

ModelName.new

then get the above error.

@svoop
Copy link
Contributor

svoop commented Dec 16, 2013

Same here on Rails 3.2

@svoop
Copy link
Contributor

svoop commented Dec 16, 2013

ActiveModel::Validations::BicValidator = BicValidation::BicValidator may help.

@svoop
Copy link
Contributor

svoop commented Dec 17, 2013

The problem is the order in which the gems are loaded (remember, a Rails 3 app). The gem hstore_flags line must come after bic_validation in order to prevent this problem.

I won't dig more into the code since it's a rare situation which most likely won't occur with a Rails 4 app (hstore baked in) and the Rails 4 version of hstore_flags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants