Expose number_projects and number_users for groups endpoint
This commit is contained in:
parent
d15521c79d
commit
a9921e9d5d
|
@ -1,4 +1,5 @@
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue