From: Eugen Rochko Date: Tue, 18 Sep 2018 20:49:24 +0000 (+0200) Subject: Fix performance regression in Account::Field#verifiable? (#8719) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=bac8227519ac0040f79c698c0bd6903427c61c51;p=mastodon.git Fix performance regression in Account::Field#verifiable? (#8719) * Fix performance regression in Account::Field#verifiable? Regression from #8703 * Fix code style issue --- diff --git a/app/models/account.rb b/app/models/account.rb index 979e0b12c..d8e5c7340 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -323,7 +323,7 @@ class Account < ApplicationRecord end def verifiable? - value.present? && /\A#{FetchLinkCardService::URL_PATTERN}\z/ =~ value + value.present? && value.start_with?('http://', 'https://') end def mark_verified!