summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/models/build.rb6
-rw-r--r--lib/api/entities.rb2
2 files changed, 6 insertions, 2 deletions
diff --git a/app/models/build.rb b/app/models/build.rb
index 814cfd8..605ed94 100644
--- a/app/models/build.rb
+++ b/app/models/build.rb
@@ -25,7 +25,7 @@ class Build < ActiveRecord::Base
serialize :push_data
attr_accessible :project_id, :ref, :sha, :before_sha,
- :status, :finished_at, :trace, :started_at, :push_data, :runner_id
+ :status, :finished_at, :trace, :started_at, :push_data, :runner_id, :project_name
validates :sha, presence: true
validates :ref, presence: true
@@ -157,4 +157,8 @@ class Build < ActiveRecord::Base
def allow_git_fetch
project.allow_git_fetch
end
+
+ def project_name
+ project.name
+ end
end
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 3c8fbcc..b6394e9 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -1,7 +1,7 @@
module API
module Entities
class Build < Grape::Entity
- expose :id, :commands, :path, :ref, :sha, :project_id, :repo_url, :before_sha, :timeout, :allow_git_fetch
+ expose :id, :commands, :path, :ref, :sha, :project_id, :repo_url, :before_sha, :timeout, :allow_git_fetch, :project_name
end
class Runner < Grape::Entity