From 86cf9dd2535adac3d739edbb845f7388e42f447d Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Mon, 30 May 2016 12:34:25 +0200 Subject: Enable Lint/LiteralInCondition rubocop cop Checks of literals used in conditions. See #17478 --- lib/gitlab/github_import/pull_request_formatter.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/gitlab/github_import/pull_request_formatter.rb b/lib/gitlab/github_import/pull_request_formatter.rb index 574737b31c1..a2947b56ad9 100644 --- a/lib/gitlab/github_import/pull_request_formatter.rb +++ b/lib/gitlab/github_import/pull_request_formatter.rb @@ -79,10 +79,9 @@ module Gitlab end def state - @state ||= case true - when raw_data.state == 'closed' && raw_data.merged_at.present? + @state ||= if raw_data.state == 'closed' && raw_data.merged_at.present? 'merged' - when raw_data.state == 'closed' + elsif raw_data.state == 'closed' 'closed' else 'opened' -- cgit v1.2.1