fixed codeclimate errors

This commit is contained in:
dinsmol 2021-09-09 13:06:51 +03:00
parent f4e0084895
commit e7e3278267
44 changed files with 118 additions and 150 deletions

View file

@ -6,9 +6,7 @@ class PhoneValidator < ActiveModel::EachValidator
country_code = phone_parts.first
subscriber_no = phone_parts.second
if zeros_only?(country_code) || zeros_only?(subscriber_no)
record.errors.add(attribute, :invalid)
end
record.errors.add(attribute, :invalid) if zeros_only?(country_code) || zeros_only?(subscriber_no)
end
private