lib/validators/phony_validator.rb in phony_rails-0.14.4 vs lib/validators/phony_validator.rb in phony_rails-0.14.5
- old
+ new
@@ -8,9 +8,10 @@
def validate_each(record, attribute, value)
return if value.blank?
@record = record
value = PhonyRails.normalize_number(value.dup, default_country_code: normalized_country_code) if normalized_country_code
+ value = PhonyRails.extract_extension(value).first
@record.errors.add(attribute, error_message) unless Phony.plausible?(value, cc: country_number)
end
private