discourse/app/serializers/topic_link_serializer.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
514 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2013-02-05 14:16:51 -05:00
class TopicLinkSerializer < ApplicationSerializer
2013-02-25 11:42:20 -05:00
attributes :url,
:title,
# :fancy_title,
2013-02-25 11:42:20 -05:00
:internal,
:attachment,
2013-02-25 11:42:20 -05:00
:reflection,
:clicks,
2014-04-05 14:47:25 -04:00
:user_id,
:domain,
:root_domain,
2013-02-05 14:16:51 -05:00
def attachment
Discourse.store.has_been_uploaded?(object.url)
2013-02-05 14:16:51 -05:00
end
2013-02-19 16:08:23 -05:00
2013-02-05 14:16:51 -05:00
def include_user_id?
object.user_id.present?
2014-04-05 14:47:25 -04:00
end
def root_domain
MiniSuffix.domain(domain)
end
2013-02-07 10:45:24 -05:00
end