Welcome to mirror list, hosted at ThFree Co, Russian Federation.

commit_entity.rb « serializers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ce76659fa466c1d5a4d4a4f4252a1887caaa93f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

class CommitEntity < API::Entities::Commit
  include RequestAwareEntity

  expose :author, using: UserEntity

  expose :author_gravatar_url do |commit|
    GravatarService.new.execute(commit.author_email) # rubocop: disable CodeReuse/ServiceClass
  end

  expose :commit_url do |commit|
    project_commit_url(request.project, commit)
  end

  expose :commit_path do |commit|
    project_commit_path(request.project, commit)
  end
end