franckverrot / activevalidators

Collection of ActiveModel/ActiveRecord validators
https://rubygems.org/gems/activevalidators
MIT License
306 stars 49 forks source link

Country gem's Country class name clashes with frequently-used Country class name in projects #66

Closed mikepence closed 8 years ago

mikepence commented 10 years ago

Loading the country gem -- regardless of whether that validation is actually used -- causes the loading of a class named Country, which -- as in the case of our project -- clashes with an existing class named Country.

mikepence commented 10 years ago

Possibly could use

gem 'countries', :require => 'iso3166'

franckverrot commented 10 years ago

Hi Mike, thanks for reporting this.

Is this still true wrt the new way of activating validators in AV 3.0 ?

franckverrot commented 10 years ago

Alright I got it. I forgot to include both phony and countries in my list of "activable" gems.

Regarding name clashes in general, there's no real solution right now. So the easy fix is to make the countries gem activable like all the other validations.

franckverrot commented 10 years ago

I've just released v3.2.0 of AV. v4 will only require iso3166 which brings the ISO3166::Country class and won't collide with any existing Country class.

Thanks!