lib/validators/phony_validator.rb in phony_rails-0.9.0 vs lib/validators/phony_validator.rb in phony_rails-0.11.0
- old
+ new
@@ -22,11 +22,11 @@
def country_number
options[:country_number] || record_country_number || country_number_from_country_code
end
def record_country_number
- @record.country_number if @record.respond_to?(:country_number)
+ @record.country_number if @record.respond_to?(:country_number) && !options[:ignore_record_country_number]
end
def country_number_from_country_code
PhonyRails.country_number_for(country_code)
end
@@ -34,10 +34,10 @@
def country_code
options[:country_code] || record_country_code
end
def record_country_code
- @record.country_code if @record.respond_to?(:country_code)
+ @record.country_code if @record.respond_to?(:country_code) && !options[:ignore_record_country_code]
end
def normalized_country_code
options[:normalized_country_code]
end