Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/github_import/representation/pull_request_review.rb')
-rw-r--r--lib/gitlab/github_import/representation/pull_request_review.rb15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/gitlab/github_import/representation/pull_request_review.rb b/lib/gitlab/github_import/representation/pull_request_review.rb
index 8a7ecf0c588..8fb57ae89a4 100644
--- a/lib/gitlab/github_import/representation/pull_request_review.rb
+++ b/lib/gitlab/github_import/representation/pull_request_review.rb
@@ -11,16 +11,19 @@ module Gitlab
expose_attribute :author, :note, :review_type, :submitted_at, :merge_request_id, :review_id
+ # Builds a PullRequestReview from a GitHub API response.
+ #
+ # review - An instance of `Hash` containing the note details.
def self.from_api_response(review, additional_data = {})
- user = Representation::User.from_api_response(review.user) if review.user
+ user = Representation::User.from_api_response(review[:user]) if review[:user]
new(
- merge_request_id: review.merge_request_id,
+ merge_request_id: review[:merge_request_id],
author: user,
- note: review.body,
- review_type: review.state,
- submitted_at: review.submitted_at,
- review_id: review.id
+ note: review[:body],
+ review_type: review[:state],
+ submitted_at: review[:submitted_at],
+ review_id: review[:id]
)
end