From f6bbf0e60384a5d8a3ee15b2b5ae81d6482c2807 Mon Sep 17 00:00:00 2001 From: Leandro Nunes dos Santos Date: Thu, 17 Apr 2014 14:52:42 -0300 Subject: [PATCH] exposing profile image for articles on api --- lib/api/entities.rb | 11 +++++++++++ 1 file changed, 11 insertions(+), 0 deletions(-) diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 8ff1a97..1750d50 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -16,6 +16,17 @@ module API } end + expose :profile do |article, options| + { + :id => article.profile.id, + :name => article.profile.name, + :icon_url => article.profile.profile_custom_image(:icon), + :minor_url => article.profile.profile_custom_image(:minor), + :portrait_url => article.profile.profile_custom_image(:portrait), + :thumb_url => article.profile.profile_custom_image(:thumb), + } + end + end class Comment < Grape::Entity -- libgit2 0.21.2