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

Expose avatar URL for groups

parent bd951384
...@@ -8,7 +8,7 @@ module GroupsHelper ...@@ -8,7 +8,7 @@ module GroupsHelper
group = Group.find_by_full_path(group) group = Group.find_by_full_path(group)
end 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 end
def group_title(group, name = nil, url = nil) def group_title(group, name = nil, url = nil)
......
...@@ -2,9 +2,9 @@ class GroupEntity < Grape::Entity ...@@ -2,9 +2,9 @@ class GroupEntity < Grape::Entity
include ActionView::Helpers::NumberHelper include ActionView::Helpers::NumberHelper
include RequestAwareEntity include RequestAwareEntity
include MembersHelper include MembersHelper
include GroupsHelper
expose :id, :name, :path, :description, :visibility expose :id, :name, :path, :description, :visibility
expose :avatar_url
expose :web_url expose :web_url
expose :full_name, :full_path expose :full_name, :full_path
expose :parent_id expose :parent_id
...@@ -39,4 +39,8 @@ class GroupEntity < Grape::Entity ...@@ -39,4 +39,8 @@ class GroupEntity < Grape::Entity
expose :number_users_with_delimiter do |group| expose :number_users_with_delimiter do |group|
number_with_delimiter(group.users.count) number_with_delimiter(group.users.count)
end end
expose :avatar_url do |group|
group_icon(group)
end
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