From c30a1ee68470a345a8cdcab4bb61c71cb6c5cc4d Mon Sep 17 00:00:00 2001 From: gdunkle Date: Tue, 29 Oct 2013 08:03:35 -0400 Subject: [PATCH] expose 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 814cfd8df..605ed9469 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 @@ def timeout 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 3c8fbcc9c..b6394e9f9 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