From 7011443b726c3c8a1b2556b20a00ebc09da62d75 Mon Sep 17 00:00:00 2001 From: GitLabHQ Admin User Date: Tue, 22 Oct 2013 15:39:32 -0400 Subject: [PATCH 1/2] add project name --- app/models/build.rb | 6 +++++- lib/api/entities.rb | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) 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 From 0373823ad909f9121ad52e7ff5f4031d56611a2e Mon Sep 17 00:00:00 2001 From: gdunkle Date: Tue, 22 Oct 2013 16:11:38 -0400 Subject: [PATCH 2/2] add project name --- app/models/build.rb | 6 +++++- lib/api/entities.rb | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) 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