Fix allow with approval option not working on username blocks (#35655)

This commit is contained in:
Eugen Rochko 2025-08-04 15:10:19 +02:00 committed by GitHub
parent c8ec649830
commit d8397040d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -43,7 +43,7 @@ class UsernameBlock < ApplicationRecord
def self.matches?(str, allow_with_approval: false)
normalized_str = str.downcase.gsub(Regexp.union(HOMOGLYPHS.keys), HOMOGLYPHS)
where(allow_with_approval: allow_with_approval).matches_exactly(normalized_str).or(matches_partially(normalized_str)).any?
matches_exactly(normalized_str).or(matches_partially(normalized_str)).where(allow_with_approval: allow_with_approval).any?
end
def to_log_human_identifier