diff options
author | Robert Speicher <robert@gitlab.com> | 2015-07-30 21:38:48 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2015-07-30 21:38:48 +0000 |
commit | a876db48d95588837895e83e92d0cf3f8a129d02 (patch) | |
tree | ea6121571eed7bae7b6a8b96d0e2f605d90d6f8e /lib | |
parent | 6d6f807b759d13d111202129d8be2c88d7be819f (diff) | |
parent | 2a60b8006b1374aec998370f9cfe5b574255712f (diff) | |
download | gitlab-ce-a876db48d95588837895e83e92d0cf3f8a129d02.tar.gz |
Merge branch 'api-new-attributes' into 'master'
Add project star and fork count, group avatar URL and user/group web URL attributes to API
Addresses internal https://dev.gitlab.org/gitlab/gitlabhq/issues/2521.
See merge request !1058
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/entities.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index ecf1412dee5..dcfd7a8e1a7 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -6,6 +6,10 @@ module API class UserBasic < UserSafe expose :id, :state, :avatar_url + + expose :web_url do |user, options| + Rails.application.routes.url_helpers.user_url(user) + end end class User < UserBasic @@ -59,6 +63,7 @@ module API expose :namespace expose :forked_from_project, using: Entities::ForkedFromProject, if: lambda{ | project, options | project.forked? } expose :avatar_url + expose :star_count, :forks_count end class ProjectMember < UserBasic @@ -69,6 +74,11 @@ module API class Group < Grape::Entity expose :id, :name, :path, :description + expose :avatar_url + + expose :web_url do |group, options| + Rails.application.routes.url_helpers.group_url(group) + end end class GroupDetail < Group |