Description
If I understand it correctly, the following line in lib/validatious-on-rails/model_validations.rb adds all the client-side and remote validations to one string and then to the html. The unless in the string inhibits identical validations to be added several times.
validator_js << v.to_js
unless existing_validators.present?
&& /#{v.name}/ =~ existing_validators
Unfortunately I had a case where several validations both had the v.name 'format-with', but with different formats. So one of them was not displayed. i solved it by also matching v.to_class in the unless. v.to_class differs because of the generated (random) params id.
validator_js << v.to_js
unless existing_validators.present?
&& /#{v.name}/ =~ existing_validators
&& /#{v.to_class}/ =~ existing_validators