Commit a9921e9d authored by Alfredo Sumaran's avatar Alfredo Sumaran

Expose number_projects and number_users for groups endpoint

parent d15521c7
class GroupEntity < Grape::Entity
include ActionView::Helpers::NumberHelper
include RequestAwareEntity
include MembersHelper
......@@ -30,4 +31,12 @@ class GroupEntity < Grape::Entity
expose :has_subgroups do |group|
group.children.any?
end
expose :number_projects do |group|
number_with_delimiter(group.projects.non_archived.count)
end
expose :number_users do |group|
number_with_delimiter(group.users.count)
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