diff options
author | blackst0ne <blackst0ne.ru@gmail.com> | 2017-05-10 15:26:17 +1100 |
---|---|---|
committer | blackst0ne <blackst0ne.ru@gmail.com> | 2017-05-10 15:26:17 +1100 |
commit | 29a3203b3fe08649b80def65b7750a866454d3d6 (patch) | |
tree | d4e644c142b1ecc6dd869c636ad5657c546d901b /lib/api/v3/entities.rb | |
parent | ecc6cc8be75b5c66fdf7f5595b71aabf9366a5e1 (diff) | |
download | gitlab-ce-29a3203b3fe08649b80def65b7750a866454d3d6.tar.gz |
Use relative paths for group/project/user avatars
Diffstat (limited to 'lib/api/v3/entities.rb')
-rw-r--r-- | lib/api/v3/entities.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/api/v3/entities.rb b/lib/api/v3/entities.rb index 7c8be7e51db..56a9b019f1b 100644 --- a/lib/api/v3/entities.rb +++ b/lib/api/v3/entities.rb @@ -69,7 +69,9 @@ module API expose :creator_id expose :namespace, using: 'API::Entities::Namespace' expose :forked_from_project, using: ::API::Entities::BasicProjectDetails, if: lambda{ |project, options| project.forked? } - expose :avatar_url + expose :avatar_url do |user, options| + user.avatar_url(only_path: false) + end expose :star_count, :forks_count expose :open_issues_count, if: lambda { |project, options| project.feature_available?(:issues, options[:current_user]) && project.default_issues_tracker? } expose :runners_token, if: lambda { |_project, options| options[:user_can_admin_project] } @@ -129,7 +131,9 @@ module API class Group < Grape::Entity expose :id, :name, :path, :description, :visibility_level expose :lfs_enabled?, as: :lfs_enabled - expose :avatar_url + expose :avatar_url do |user, options| + user.avatar_url(only_path: false) + end expose :web_url expose :request_access_enabled expose :full_name, :full_path |