Skip to content
Snippets Groups Projects
Commit fad5c291 authored by Bruno FS's avatar Bruno FS
Browse files

added 'followed' to user_serializer

parent 5ba4ff7a
Branches
Tags
No related merge requests found
class UserSerializer < ActiveModel::Serializer
cache key: 'user', expires_in: 4.hours, except: [ :complained ]
cache key: 'user', expires_in: 4.hours, except: [ :complained, :followed ]
def complained
object.complained? current_user
end
attributes :id, :email, :provider, :name, :description, :role_ids, :institution_ids, :avatar, :likes_count, :complained, :follows_count, :learning_objects_count, :collections_count, :created_at, :updated_at
def followed
object.followed? current_user
end
attributes :id, :email, :provider, :name, :description, :role_ids, :institution_ids, :avatar, :likes_count, :followed, :complained, :follows_count, :learning_objects_count, :collections_count, :created_at, :updated_at
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment