Class: UserPostBookmarkSerializer
- Inherits:
-
UserPostTopicBookmarkBaseSerializer
- Object
- ActiveModel::Serializer
- ApplicationSerializer
- UserBookmarkBaseSerializer
- UserPostTopicBookmarkBaseSerializer
- UserPostBookmarkSerializer
- Defined in:
- app/serializers/user_post_bookmark_serializer.rb
Constant Summary
Constants included from TopicTagsMixin
TopicTagsMixin::DESCRIPTION_LIMIT
Instance Method Summary collapse
-
#bookmarkable_url ⇒ Object
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.
- #bookmarkable_user ⇒ Object
- #cooked ⇒ Object
- #deleted ⇒ Object
- #hidden ⇒ Object
- #linked_post_number ⇒ Object
- #post_id ⇒ Object
- #raw ⇒ Object
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
Instance Method Details
#bookmarkable_url ⇒ Object
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_user ⇒ Object
28 29 30 |
# File 'app/serializers/user_post_bookmark_serializer.rb', line 28 def bookmarkable_user @bookmarkable_user ||= post.user end |
#cooked ⇒ Object
24 25 26 |
# File 'app/serializers/user_post_bookmark_serializer.rb', line 24 def cooked post.cooked end |
#deleted ⇒ Object
12 13 14 |
# File 'app/serializers/user_post_bookmark_serializer.rb', line 12 def deleted topic.deleted_at.present? || post.deleted_at.present? end |
#hidden ⇒ Object
16 17 18 |
# File 'app/serializers/user_post_bookmark_serializer.rb', line 16 def hidden post.hidden end |
#linked_post_number ⇒ Object
8 9 10 |
# File 'app/serializers/user_post_bookmark_serializer.rb', line 8 def linked_post_number post.post_number end |
#post_id ⇒ Object
4 5 6 |
# File 'app/serializers/user_post_bookmark_serializer.rb', line 4 def post_id post.id end |
#raw ⇒ Object
20 21 22 |
# File 'app/serializers/user_post_bookmark_serializer.rb', line 20 def raw post.raw end |