discourse/app/serializers/topic_link_serializer.rb
David Taylor f05da14fb6
DEV: Do not include method definitions in serializer attributes
These accidental inclusions are mostly no-ops (because the method name is also included as an explicit symbol). The mistakes were made more obvious because syntax_tree adjusted the indentation of these methods
2023-01-09 14:15:00 +00:00

27 lines
511 B
Ruby

# frozen_string_literal: true
class TopicLinkSerializer < ApplicationSerializer
attributes :url,
:title,
# :fancy_title,
:internal,
:attachment,
:reflection,
:clicks,
:user_id,
:domain,
:root_domain
def attachment
Discourse.store.has_been_uploaded?(object.url)
end
def include_user_id?
object.user_id.present?
end
def root_domain
MiniSuffix.domain(domain)
end
end