2022-04-21 17:23:42 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-01-09 06:20:10 -06:00
|
|
|
require_relative "post_item_excerpt"
|
2022-04-21 17:23:42 -05:00
|
|
|
|
|
|
|
class UserPostTopicBookmarkBaseSerializer < UserBookmarkBaseSerializer
|
|
|
|
include TopicTagsMixin
|
|
|
|
include PostItemExcerpt
|
|
|
|
|
|
|
|
attributes :topic_id,
|
|
|
|
:linked_post_number,
|
|
|
|
:deleted,
|
|
|
|
:hidden,
|
|
|
|
:category_id,
|
|
|
|
:closed,
|
|
|
|
:archived,
|
|
|
|
:archetype,
|
|
|
|
:highest_post_number,
|
|
|
|
:bumped_at,
|
|
|
|
:slug
|
|
|
|
|
|
|
|
def topic_id
|
|
|
|
topic.id
|
|
|
|
end
|
|
|
|
|
|
|
|
def title
|
|
|
|
topic.title
|
|
|
|
end
|
|
|
|
|
|
|
|
def fancy_title
|
|
|
|
topic.fancy_title
|
|
|
|
end
|
|
|
|
|
|
|
|
def category_id
|
|
|
|
topic.category_id
|
|
|
|
end
|
|
|
|
|
|
|
|
def archetype
|
|
|
|
topic.archetype
|
|
|
|
end
|
|
|
|
|
|
|
|
def archived
|
|
|
|
topic.archived
|
|
|
|
end
|
|
|
|
|
|
|
|
def closed
|
|
|
|
topic.closed
|
|
|
|
end
|
|
|
|
|
|
|
|
def highest_post_number
|
2022-06-29 19:18:12 -05:00
|
|
|
scope.is_whisperer? ? topic.highest_staff_post_number : topic.highest_post_number
|
2022-04-21 17:23:42 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def bumped_at
|
|
|
|
topic.bumped_at
|
|
|
|
end
|
|
|
|
|
|
|
|
def slug
|
|
|
|
topic.slug
|
|
|
|
end
|
|
|
|
end
|