debian-mirror-gitlab/lib/api/entities/user_associations_count.rb

24 lines
437 B
Ruby
Raw Normal View History

2023-01-13 00:05:48 +05:30
# frozen_string_literal: true
module API
module Entities
class UserAssociationsCount < Grape::Entity
expose :groups_count do |user|
user.groups.size
end
expose :projects_count do |user|
user.projects.size
end
expose :issues_count do |user|
user.issues.size
end
expose :merge_requests_count do |user|
user.merge_requests.size
end
end
end
end