Treat non-null but blank account domain as local (#33576)

This commit is contained in:
Matt Jankowski
2025-01-14 12:40:55 -05:00
committed by GitHub
parent e1d7efadc0
commit 68c9f91ccb
3 changed files with 14 additions and 14 deletions

View File

@@ -126,6 +126,8 @@ class Account < ApplicationRecord
validates :uri, absence: true
end
validates :domain, exclusion: { in: [''] }
normalizes :username, with: ->(username) { username.squish }
scope :without_internal, -> { where(id: 1...) }
@@ -187,7 +189,7 @@ class Account < ApplicationRecord
end
def remote?
domain.present?
!domain.nil?
end
def moved?