diff options
author | Simon Knox <psimyn@gmail.com> | 2017-02-16 13:10:32 +1100 |
---|---|---|
committer | Simon Knox <psimyn@gmail.com> | 2017-02-16 13:10:32 +1100 |
commit | 8a928af0fc54a84c5b858955e7459512155d4af0 (patch) | |
tree | 4c55ff6c1cd20405e9adf5973e2ce1c229fcebde /lib/api/entities.rb | |
parent | 3f713db0da2602152aa482b57f84b7418fd20a93 (diff) | |
parent | b05e75b8faccc50749adc63419074c91802a8f50 (diff) | |
download | gitlab-ce-task_list_refactor.tar.gz |
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into task_list_refactortask_list_refactor
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r-- | lib/api/entities.rb | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 2a071e649fa..232f231ddd2 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -155,10 +155,27 @@ module API expose :shared_projects, using: Entities::Project end + class RepoCommit < Grape::Entity + expose :id, :short_id, :title, :created_at + expose :parent_ids + expose :safe_message, as: :message + expose :author_name, :author_email, :authored_date + expose :committer_name, :committer_email, :committed_date + end + + class RepoCommitStats < Grape::Entity + expose :additions, :deletions, :total + end + + class RepoCommitDetail < RepoCommit + expose :stats, using: Entities::RepoCommitStats + expose :status + end + class RepoBranch < Grape::Entity expose :name - expose :commit do |repo_branch, options| + expose :commit, using: Entities::RepoCommit do |repo_branch, options| options[:project].repository.commit(repo_branch.dereferenced_target) end @@ -193,22 +210,6 @@ module API end end - class RepoCommit < Grape::Entity - expose :id, :short_id, :title, :author_name, :author_email, :created_at - expose :committer_name, :committer_email - expose :safe_message, as: :message - end - - class RepoCommitStats < Grape::Entity - expose :additions, :deletions, :total - end - - class RepoCommitDetail < RepoCommit - expose :parent_ids, :committed_date, :authored_date - expose :stats, using: Entities::RepoCommitStats - expose :status - end - class ProjectSnippet < Grape::Entity expose :id, :title, :file_name expose :author, using: Entities::UserBasic @@ -367,7 +368,7 @@ module API class CommitStatus < Grape::Entity expose :id, :sha, :ref, :status, :name, :target_url, :description, - :created_at, :started_at, :finished_at, :allow_failure + :created_at, :started_at, :finished_at, :allow_failure, :coverage expose :author, using: Entities::UserBasic end @@ -414,7 +415,7 @@ module API end class Namespace < Grape::Entity - expose :id, :name, :path, :kind + expose :id, :name, :path, :kind, :full_path end class MemberAccess < Grape::Entity |