Skip to content
Snippets Groups Projects
Commit 657ad1c9 authored by Israel Barreto Sant'Anna's avatar Israel Barreto Sant'Anna
Browse files

Merge branch 'followed-attribute' into 'master'

added 'followed' to user_serializer

See merge request !369
parents 8b058bcd fad5c291
No related branches found
No related tags found
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.
Finish editing this message first!
Please register or to comment