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

Expose the project name #301

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion app/models/build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -139,6 +139,10 @@ def commit_data
def repo_url
project.ssh_url_to_repo
end

def project_name
project.name
end
end


2 changes: 1 addition & 1 deletion lib/api/entities.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down