summaryrefslogtreecommitdiff
path: root/lib/bitbucket_server
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-08-02 14:45:54 -0700
committerStan Hu <stanhu@gmail.com>2018-08-02 14:45:54 -0700
commitf2a99398bfd66a1971c2d26461fec508106e6eb9 (patch)
tree57078411feae642516981cfcdde868f0dd8d469a /lib/bitbucket_server
parenta662670b90b67b814a91390998feae015138e753 (diff)
downloadgitlab-ce-f2a99398bfd66a1971c2d26461fec508106e6eb9.tar.gz
Use a case statement to determine pull request state
Diffstat (limited to 'lib/bitbucket_server')
-rw-r--r--lib/bitbucket_server/representation/pull_request.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/bitbucket_server/representation/pull_request.rb b/lib/bitbucket_server/representation/pull_request.rb
index 4bb00d22b0c..c3e927d8de7 100644
--- a/lib/bitbucket_server/representation/pull_request.rb
+++ b/lib/bitbucket_server/representation/pull_request.rb
@@ -20,9 +20,10 @@ module BitbucketServer
end
def state
- if raw['state'] == 'MERGED'
+ case raw['state']
+ when 'MERGED'
'merged'
- elsif raw['state'] == 'DECLINED'
+ when 'DECLINED'
'closed'
else
'opened'