Make antenna able to insert home

This commit is contained in:
KMY 2023-05-09 15:07:29 +09:00
parent 7c118ed1d0
commit 9429f5b60c
7 changed files with 34 additions and 8 deletions

View file

@ -31,7 +31,7 @@ class Antenna < ApplicationRecord
has_many :antenna_accounts, inverse_of: :antenna, dependent: :destroy
belongs_to :account
belongs_to :list
belongs_to :list, optional: true
scope :all_keywords, -> { where(any_keywords: true) }
scope :all_domains, -> { where(any_domains: true) }
@ -42,7 +42,7 @@ class Antenna < ApplicationRecord
validate :list_owner
def list_owner
raise Mastodon::ValidationError, I18n.t('antennas.errors.invalid_list_owner') if list.account != account
raise Mastodon::ValidationError, I18n.t('antennas.errors.invalid_list_owner') if list.present? && list.account != account
end
def enabled?