Skip to content
This repository was archived by the owner on May 12, 2018. It is now read-only.

Commit 534edde

Browse files
committed
Merge pull request #307 from gdunkle/with_project_name_2
expose project name
2 parents f9df14d + c30a1ee commit 534edde

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

app/models/build.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Build < ActiveRecord::Base
2525
serialize :push_data
2626

2727
attr_accessible :project_id, :ref, :sha, :before_sha,
28-
:status, :finished_at, :trace, :started_at, :push_data, :runner_id
28+
:status, :finished_at, :trace, :started_at, :push_data, :runner_id, :project_name
2929

3030
validates :sha, presence: true
3131
validates :ref, presence: true
@@ -157,4 +157,8 @@ def timeout
157157
def allow_git_fetch
158158
project.allow_git_fetch
159159
end
160+
161+
def project_name
162+
project.name
163+
end
160164
end

lib/api/entities.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module API
22
module Entities
33
class Build < Grape::Entity
4-
expose :id, :commands, :path, :ref, :sha, :project_id, :repo_url, :before_sha, :timeout, :allow_git_fetch
4+
expose :id, :commands, :path, :ref, :sha, :project_id, :repo_url, :before_sha, :timeout, :allow_git_fetch, :project_name
55
end
66

77
class Runner < Grape::Entity

0 commit comments

Comments
 (0)