diff --git a/app/models/build.rb b/app/models/build.rb index 7e9d418eb..e1e277cb4 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 @@ -139,6 +139,10 @@ def commit_data def repo_url project.ssh_url_to_repo end + + def project_name + project.name + end end diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 68b05cb81..e26ce6c0e 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 + expose :id, :commands, :path, :ref, :sha, :project_id, :repo_url, :project_name end class Runner < Grape::Entity