mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 00:42:04 +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
|
@ -22,7 +22,7 @@ class DomainNameValidator < ActiveModel::EachValidator
|
|||
# it's punycode
|
||||
if value[2] == '-' && value[3] == '-'
|
||||
regexp = /\Axn--[a-zA-Z0-9-]{0,59}\.#{general_domains}\z/
|
||||
return false unless value =~ regexp
|
||||
return false unless value.match?(regexp)
|
||||
value = SimpleIDN.to_unicode(value).mb_chars.downcase.strip
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue