Add antenna editor page
This commit is contained in:
parent
87a8da93e8
commit
f99dde6df1
25 changed files with 1187 additions and 122 deletions
|
@ -1,9 +1,35 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class REST::AntennaSerializer < ActiveModel::Serializer
|
||||
attributes :id, :title
|
||||
attributes :id, :title, :stl, :with_media_only, :ignore_reblog, :accounts_count, :domains_count, :tags_count, :keywords_count
|
||||
|
||||
class ListSerializer < ActiveModel::Serializer
|
||||
attributes :id, :title
|
||||
|
||||
def id
|
||||
object.id.to_s
|
||||
end
|
||||
end
|
||||
|
||||
has_one :list, serializer: ListSerializer, optional: true
|
||||
|
||||
def id
|
||||
object.id.to_s
|
||||
end
|
||||
|
||||
def accounts_count
|
||||
object.antenna_accounts.count
|
||||
end
|
||||
|
||||
def domains_count
|
||||
object.antenna_domains.count
|
||||
end
|
||||
|
||||
def tags_count
|
||||
object.antenna_tags.count
|
||||
end
|
||||
|
||||
def keywords_count
|
||||
object.keywords&.size || 0
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue