diff options
author | Jeroen van Baarsen <jeroenvanbaarsen@gmail.com> | 2015-02-02 22:08:10 +0100 |
---|---|---|
committer | Jeroen van Baarsen <jeroenvanbaarsen@gmail.com> | 2015-02-04 10:24:25 +0100 |
commit | b60d06eb2c91a61b91a214dac0f0f526b146f8d7 (patch) | |
tree | 9f3070d6e3d9a0a4b208715c962dcc43bf3e65e5 /lib/api/entities.rb | |
parent | c0acb28c4ec710c90eb55dc996251a30001c8e79 (diff) | |
download | gitlab-ce-b60d06eb2c91a61b91a214dac0f0f526b146f8d7.tar.gz |
Added a way to retrieve MR files
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r-- | lib/api/entities.rb | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index ac166ed4fba..96920718ab5 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -147,6 +147,11 @@ module API expose :state, :created_at, :updated_at end + class RepoDiff < Grape::Entity + expose :old_path, :new_path, :a_mode, :b_mode, :diff + expose :new_file, :renamed_file, :deleted_file + end + class Milestone < ProjectEntity expose :due_date end @@ -166,6 +171,12 @@ module API expose :milestone, using: Entities::Milestone end + class MergeRequestChanges < MergeRequest + expose :diffs, as: :changes, using: Entities::RepoDiff do |compare, _| + compare.diffs + end + end + class SSHKey < Grape::Entity expose :id, :title, :key, :created_at end @@ -236,11 +247,6 @@ module API expose :name, :color end - class RepoDiff < Grape::Entity - expose :old_path, :new_path, :a_mode, :b_mode, :diff - expose :new_file, :renamed_file, :deleted_file - end - class Compare < Grape::Entity expose :commit, using: Entities::RepoCommit do |compare, options| Commit.decorate(compare.commits).last |