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

expose project name #307

Merged
merged 1 commit into from
Oct 29, 2013
Merged
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 @@ -157,4 +157,8 @@ def timeout
def allow_git_fetch
project.allow_git_fetch
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, :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
Expand Down