Class: ReviewablePostSerializer

Inherits:
ReviewableSerializer show all
Defined in:
app/serializers/reviewable_post_serializer.rb

Instance Method Summary collapse

Methods inherited from ReviewableSerializer

#attributes, #bundled_actions, #can_edit, #claimed_by, create_attribute, #created_from_flag?, #editable_fields, #include_category_id?, #include_claimed_by?, #include_target_url?, #include_topic_id?, #include_topic_tags?, #include_topic_url?, payload_attributes, target_attributes, #target_created_by_trust_level, #target_url, #topic_tags, #topic_url

Methods inherited from ApplicationSerializer

expire_cache_fragment!, fragment_cache

Methods inherited from ActiveModel::Serializer

#include!

Instance Method Details

#blank_postObject



15
16
17
# File 'app/serializers/reviewable_post_serializer.rb', line 15

def blank_post
  true
end

#include_blank_post?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'app/serializers/reviewable_post_serializer.rb', line 19

def include_blank_post?
  object.target.blank?
end

#post_updated_atObject



11
12
13
# File 'app/serializers/reviewable_post_serializer.rb', line 11

def post_updated_at
  object.target&.updated_at
end

#post_versionObject



7
8
9
# File 'app/serializers/reviewable_post_serializer.rb', line 7

def post_version
  object.target&.version
end