debian-mirror-gitlab/app/serializers/commit_entity.rb

18 lines
393 B
Ruby
Raw Normal View History

2018-03-17 18:26:18 +05:30
class CommitEntity < API::Entities::Commit
2017-08-17 22:00:37 +05:30
include RequestAwareEntity
expose :author, using: UserEntity
expose :author_gravatar_url do |commit|
GravatarService.new.execute(commit.author_email)
end
expose :commit_url do |commit|
2017-09-10 17:25:29 +05:30
project_commit_url(request.project, commit)
2017-08-17 22:00:37 +05:30
end
expose :commit_path do |commit|
2017-09-10 17:25:29 +05:30
project_commit_path(request.project, commit)
2017-08-17 22:00:37 +05:30
end
end