Commit 3427912e authored by Alfredo Sumaran's avatar Alfredo Sumaran

Expose avatar URL for groups

parent bd951384
......@@ -8,7 +8,7 @@ module GroupsHelper
group = Group.find_by_full_path(group)
end
group.try(:avatar_url) || image_path('no_group_avatar.png')
group.try(:avatar_url) || ActionController::Base.helpers.image_path('no_group_avatar.png')
end
def group_title(group, name = nil, url = nil)
......
......@@ -2,9 +2,9 @@ class GroupEntity < Grape::Entity
include ActionView::Helpers::NumberHelper
include RequestAwareEntity
include MembersHelper
include GroupsHelper
expose :id, :name, :path, :description, :visibility
expose :avatar_url
expose :web_url
expose :full_name, :full_path
expose :parent_id
......@@ -39,4 +39,8 @@ class GroupEntity < Grape::Entity
expose :number_users_with_delimiter do |group|
number_with_delimiter(group.users.count)
end
expose :avatar_url do |group|
group_icon(group)
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment