summaryrefslogtreecommitdiff
path: root/lib/github/representation/pull_request.rb
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-10-05 10:43:18 +0200
committerRémy Coutable <remy@rymai.me>2017-10-05 10:48:26 +0200
commita55e150177934145c3daeecb678cce1b16f0a3b8 (patch)
tree5b9e4fe9c800b0ffab2f08eb3b8b04dcd5ece464 /lib/github/representation/pull_request.rb
parentf96b4f41412b4e974fe77a1b58d6570252fd62d9 (diff)
downloadgitlab-ce-a55e150177934145c3daeecb678cce1b16f0a3b8.tar.gz
Set `label_ids` and `assignee_ids` after the initial `save!`.
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'lib/github/representation/pull_request.rb')
-rw-r--r--lib/github/representation/pull_request.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/github/representation/pull_request.rb b/lib/github/representation/pull_request.rb
index bb35061c642..9baa7af4ffa 100644
--- a/lib/github/representation/pull_request.rb
+++ b/lib/github/representation/pull_request.rb
@@ -37,6 +37,16 @@ module Github
source_branch.valid? && target_branch.valid?
end
+ def assigned?
+ raw['assignee'].present?
+ end
+
+ def assignee
+ return unless assigned?
+
+ @assignee ||= Github::Representation::User.new(raw['assignee'], options)
+ end
+
private
def project