Add antenna list account validation
This commit is contained in:
parent
2fef21664b
commit
9d4b306f08
3 changed files with 8 additions and 0 deletions
|
@ -34,6 +34,12 @@ class Antenna < ApplicationRecord
|
|||
scope :all_tags, -> { where(any_tags: true) }
|
||||
scope :availables, -> { where(available: true).where(Arel.sql('any_keywords = FALSE OR any_domains = FALSE OR any_accounts = FALSE OR any_tags = FALSE')) }
|
||||
|
||||
validate :list_owner
|
||||
|
||||
def list_owner
|
||||
raise Mastodon::ValidationError, I18n.t('antennas.errors.invalid_list_owner') if list.account != account
|
||||
end
|
||||
|
||||
def enabled?
|
||||
enabled_config? && !expired?
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue