jam-cloud/web/app/views/api_users/following_index.rabl

27 lines
454 B
Ruby

collection @user.followings
node :id do |following|
following.followable.id
end
node :name do |following|
following.followable.name
end
node :location do |following|
following.followable.location
end
node :musician do |following|
if following.followable.instance_of?(JamRuby::User)
following.followable.musician
end
end
node :photo_url do |following|
following.followable.photo_url
end
node :type do |following|
following.type
end