Class: UserPostBookmarkSerializer
- Inherits:
-
UserPostTopicBookmarkBaseSerializer
- Object
- ActiveModel::Serializer
- ApplicationSerializer
- UserBookmarkBaseSerializer
- UserPostTopicBookmarkBaseSerializer
- UserPostBookmarkSerializer
- Defined in:
- app/serializers/user_post_bookmark_serializer.rb
Instance Attribute Summary collapse
-
#post_id ⇒ Object
readonly
Returns the value of attribute post_id.
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
- #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 Attribute Details
#post_id ⇒ Object (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_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.
36 37 38 |
# File 'app/serializers/user_post_bookmark_serializer.rb', line 36 def bookmarkable_url post.full_url end |
#bookmarkable_user ⇒ Object
30 31 32 |
# File 'app/serializers/user_post_bookmark_serializer.rb', line 30 def bookmarkable_user @bookmarkable_user ||= post.user end |
#cooked ⇒ Object
26 27 28 |
# File 'app/serializers/user_post_bookmark_serializer.rb', line 26 def cooked post.cooked end |
#deleted ⇒ Object
14 15 16 |
# File 'app/serializers/user_post_bookmark_serializer.rb', line 14 def deleted topic.deleted_at.present? || post.deleted_at.present? end |
#hidden ⇒ Object
18 19 20 |
# File 'app/serializers/user_post_bookmark_serializer.rb', line 18 def hidden post.hidden end |
#linked_post_number ⇒ Object
10 11 12 |
# File 'app/serializers/user_post_bookmark_serializer.rb', line 10 def linked_post_number post.post_number end |
#raw ⇒ Object
22 23 24 |
# File 'app/serializers/user_post_bookmark_serializer.rb', line 22 def raw post.raw end |