2017-10-05 04:48:05 -04:00
|
|
|
class CommitEntity < API::Entities::Commit
|
2016-11-03 07:54:10 -04:00
|
|
|
include RequestAwareEntity
|
|
|
|
|
2016-11-04 08:08:58 -04:00
|
|
|
expose :author, using: UserEntity
|
2016-11-04 05:16:30 -04:00
|
|
|
|
2016-11-12 04:53:03 -05:00
|
|
|
expose :author_gravatar_url do |commit|
|
|
|
|
GravatarService.new.execute(commit.author_email)
|
|
|
|
end
|
|
|
|
|
2016-11-03 07:54:10 -04:00
|
|
|
expose :commit_url do |commit|
|
2017-06-29 13:06:35 -04:00
|
|
|
project_commit_url(request.project, commit)
|
2016-11-03 07:54:10 -04:00
|
|
|
end
|
2016-11-18 16:31:26 -05:00
|
|
|
|
2016-11-17 10:08:05 -05:00
|
|
|
expose :commit_path do |commit|
|
2017-06-29 13:06:35 -04:00
|
|
|
project_commit_path(request.project, commit)
|
2016-11-03 07:54:10 -04:00
|
|
|
end
|
|
|
|
end
|