Class: PostActionUserSerializer

Inherits:
BasicUserSerializer show all
Defined in:
app/serializers/post_action_user_serializer.rb

Instance Method Summary collapse

Methods inherited from BasicUserSerializer

#categories_with_notification_level, #category_user_notification_levels, #include_name?, #name, #user, #user_is_current_user

Methods inherited from ApplicationSerializer

expire_cache_fragment!, fragment_cache

Methods inherited from ActiveModel::Serializer

#include!

Instance Method Details

#avatar_templateObject



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

def avatar_template
  object.user.avatar_template
end

#idObject



6
7
8
# File 'app/serializers/post_action_user_serializer.rb', line 6

def id
  object.user.id
end

#include_unknown?Boolean

Returns:

  • (Boolean)


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

def include_unknown?
  (@options[:unknown_user_ids] || []).include?(object.user.id)
end

#post_urlObject



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

def post_url
  object.related_post.url if object.related_post_id && object.related_post
end

#unknownObject



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

def unknown
  true
end

#usernameObject



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

def username
  object.user.username
end

#username_lowerObject



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

def username_lower
  object.user.username_lower
end