2016-11-03 11:54:10 +00:00
|
|
|
class CommitEntity < API::Entities::RepoCommit
|
|
|
|
include RequestAwareEntity
|
|
|
|
|
2016-11-04 12:08:58 +00:00
|
|
|
expose :author, using: UserEntity
|
2016-11-04 09:16:30 +00:00
|
|
|
|
2016-11-12 09:53:03 +00:00
|
|
|
expose :author_gravatar_url do |commit|
|
|
|
|
GravatarService.new.execute(commit.author_email)
|
|
|
|
end
|
|
|
|
|
2016-11-03 11:54:10 +00:00
|
|
|
expose :commit_url do |commit|
|
2017-01-13 12:07:32 +00:00
|
|
|
namespace_project_commit_url(
|
2016-11-04 14:00:39 +00:00
|
|
|
request.project.namespace,
|
|
|
|
request.project,
|
2017-01-13 12:07:32 +00:00
|
|
|
commit)
|
2016-11-03 11:54:10 +00:00
|
|
|
end
|
2016-11-18 21:31:26 +00:00
|
|
|
|
2016-11-17 15:08:05 +00:00
|
|
|
expose :commit_path do |commit|
|
2017-01-13 12:07:32 +00:00
|
|
|
namespace_project_commit_path(
|
2016-11-04 14:00:39 +00:00
|
|
|
request.project.namespace,
|
|
|
|
request.project,
|
2017-01-13 12:07:32 +00:00
|
|
|
commit)
|
2016-11-03 11:54:10 +00:00
|
|
|
end
|
|
|
|
end
|