BigW Consortium Gitlab

commit_entity.rb 509 Bytes
Newer Older
1 2 3
class CommitEntity < API::Entities::RepoCommit
  include RequestAwareEntity

4
  expose :author, using: UserEntity
5

6 7 8 9
  expose :author_gravatar_url do |commit|
    GravatarService.new.execute(commit.author_email)
  end

10
  expose :commit_url do |commit|
11
    namespace_project_commit_url(
12 13
      request.project.namespace,
      request.project,
14
      commit)
15
  end
16

17
  expose :commit_path do |commit|
18
    namespace_project_commit_path(
19 20
      request.project.namespace,
      request.project,
21
      commit)
22 23
  end
end