mirror of
https://github.com/internetee/registry.git
synced 2025-08-06 01:35:10 +02:00
Use match? instead of match
for regex where MatchData is unused
This commit is contained in:
parent
db08ad7125
commit
82dbd3e8b8
7 changed files with 12 additions and 10 deletions
|
@ -10,7 +10,9 @@ class Contact::Ident::RegNoValidator < ActiveModel::EachValidator
|
|||
|
||||
return unless format
|
||||
|
||||
record.errors.add(attribute, :invalid_reg_no, country: record.country) unless value =~ format
|
||||
unless value.match?(format)
|
||||
record.errors.add(attribute, :invalid_reg_no, country: record.country)
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue