diff options
| author | Douwe Maan <douwe@selenight.nl> | 2017-09-26 10:49:53 +0200 | 
|---|---|---|
| committer | Douwe Maan <douwe@selenight.nl> | 2017-09-26 12:47:48 +0200 | 
| commit | a019369409e38ee6cb36e5782cefd8c944b12e53 (patch) | |
| tree | 17e76f5075a6c51512523dc77fc6a6d60089373b /lib/api/entities.rb | |
| parent | 923ad9a9e2ffca550a06d0cbbd89ac6f276c4605 (diff) | |
| download | gitlab-ce-a019369409e38ee6cb36e5782cefd8c944b12e53.tar.gz | |
Expose avatar_url when requesting list of projects from API with simple=truedm-simple-project-avatar-url
Diffstat (limited to 'lib/api/entities.rb')
| -rw-r--r-- | lib/api/entities.rb | 11 | 
1 files changed, 6 insertions, 5 deletions
| diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 71253f72533..9776a9dd74b 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -89,6 +89,9 @@ module API        expose :ssh_url_to_repo, :http_url_to_repo, :web_url        expose :name, :name_with_namespace        expose :path, :path_with_namespace +      expose :avatar_url do |project, options| +        project.avatar_url(only_path: false) +      end        expose :star_count, :forks_count        expose :created_at, :last_activity_at      end @@ -146,9 +149,7 @@ module API        expose :forked_from_project, using: Entities::BasicProjectDetails, if: lambda { |project, options| project.forked? }        expose :import_status        expose :import_error, if: lambda { |_project, options| options[:user_can_admin_project] } -      expose :avatar_url do |user, options| -        user.avatar_url(only_path: false) -      end +        expose :open_issues_count, if: lambda { |project, options| project.feature_available?(:issues, options[:current_user]) }        expose :runners_token, if: lambda { |_project, options| options[:user_can_admin_project] }        expose :public_builds, as: :public_jobs @@ -193,8 +194,8 @@ module API      class Group < Grape::Entity        expose :id, :name, :path, :description, :visibility        expose :lfs_enabled?, as: :lfs_enabled -      expose :avatar_url do |user, options| -        user.avatar_url(only_path: false) +      expose :avatar_url do |group, options| +        group.avatar_url(only_path: false)        end        expose :web_url        expose :request_access_enabled | 
