Class: UserPostBookmarkSerializer

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

Instance Attribute Summary collapse

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 Attribute Details

#post_idObject (readonly)

Returns the value of attribute post_id.



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

def post_id
  @post_id
end

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.



36
37
38
# File 'app/serializers/user_post_bookmark_serializer.rb', line 36

def bookmarkable_url
  post.full_url
end

#bookmarkable_userObject



30
31
32
# File 'app/serializers/user_post_bookmark_serializer.rb', line 30

def bookmarkable_user
  @bookmarkable_user ||= post.user
end

#cookedObject



26
27
28
# File 'app/serializers/user_post_bookmark_serializer.rb', line 26

def cooked
  post.cooked
end

#deletedObject



14
15
16
# File 'app/serializers/user_post_bookmark_serializer.rb', line 14

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

#hiddenObject



18
19
20
# File 'app/serializers/user_post_bookmark_serializer.rb', line 18

def hidden
  post.hidden
end

#linked_post_numberObject



10
11
12
# File 'app/serializers/user_post_bookmark_serializer.rb', line 10

def linked_post_number
  post.post_number
end

#rawObject



22
23
24
# File 'app/serializers/user_post_bookmark_serializer.rb', line 22

def raw
  post.raw
end