summaryrefslogtreecommitdiff
path: root/app/serializers/commit_entity.rb
blob: acc20f6dc52f69ba205454f0491361cad243bcf1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
class CommitEntity < API::Entities::RepoCommit
  include RequestAwareEntity

  expose :author, using: UserEntity

  expose :commit_url do |commit|
    namespace_project_tree_url(
      request.project.namespace,
      request.project,
      id: commit.id)
  end

  expose :commit_path do |commit|
    namespace_project_tree_path(
      request.project.namespace,
      request.project,
      id: commit.id)
  end
end