Class: UserPostBookmarkSerializer

Inherits:
UserPostTopicBookmarkBaseSerializer show all
Defined in:
app/serializers/user_post_bookmark_serializer.rb

Constant Summary

Constants included from TopicTagsMixin

TopicTagsMixin::DESCRIPTION_LIMIT

Instance Method Summary collapse

Methods inherited from UserPostTopicBookmarkBaseSerializer

#archetype, #archived, #bumped_at, #category_id, #closed, #fancy_title, #highest_post_number, #slug, #title, #topic_id

Methods included from PostItemExcerpt

#excerpt, #include_truncated?, included, #truncated

Methods included from TopicTagsMixin

#include_tags?, included, #tags, #tags_descriptions

Methods inherited from UserBookmarkBaseSerializer

#excerpt, #fancy_title, #include_reminder_at_ics_end?, #include_reminder_at_ics_start?, #reminder_at_ics_end, #reminder_at_ics_start, #title, #user

Methods inherited from ApplicationSerializer

expire_cache_fragment!, fragment_cache

Methods inherited from ActiveModel::Serializer

#include!

Instance Method Details

#bookmarkable_urlObject

NOTE: In the UI there are special topic-status and topic-link components to display the topic URL, this is only used for certain routes like the .ics bookmarks.



34
35
36
# File 'app/serializers/user_post_bookmark_serializer.rb', line 34

def bookmarkable_url
  post.full_url
end

#bookmarkable_userObject



28
29
30
# File 'app/serializers/user_post_bookmark_serializer.rb', line 28

def bookmarkable_user
  @bookmarkable_user ||= post.user
end

#cookedObject



24
25
26
# File 'app/serializers/user_post_bookmark_serializer.rb', line 24

def cooked
  post.cooked
end

#deletedObject



12
13
14
# File 'app/serializers/user_post_bookmark_serializer.rb', line 12

def deleted
  topic.deleted_at.present? || post.deleted_at.present?
end

#hiddenObject



16
17
18
# File 'app/serializers/user_post_bookmark_serializer.rb', line 16

def hidden
  post.hidden
end

#linked_post_numberObject



8
9
10
# File 'app/serializers/user_post_bookmark_serializer.rb', line 8

def linked_post_number
  post.post_number
end

#post_idObject



4
5
6
# File 'app/serializers/user_post_bookmark_serializer.rb', line 4

def post_id
  post.id
end

#rawObject



20
21
22
# File 'app/serializers/user_post_bookmark_serializer.rb', line 20

def raw
  post.raw
end