summaryrefslogtreecommitdiff
path: root/lib/api/helpers.rb
diff options
context:
space:
mode:
authorNermin Vehabovic <nermin.vehabovic90@gmail.com>2019-02-16 11:52:21 +0100
committerNermin Vehabovic <nermin.vehabovic90@gmail.com>2019-02-16 11:52:21 +0100
commitf43cb6e79d36345a207aaaf00179c5acf9b5a3b3 (patch)
tree94867f063c58cbfd34816d8ef8bcc3bd63d80dbc /lib/api/helpers.rb
parentff671366cb80a78c2846d5407d2380680a47a90d (diff)
downloadgitlab-ce-f43cb6e79d36345a207aaaf00179c5acf9b5a3b3.tar.gz
Fixed: Warnings from static code analysis
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r--lib/api/helpers.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index 4d1b7714123..4656b27c5d1 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -397,13 +397,11 @@ module API
end
# rubocop: enable CodeReuse/ActiveRecord
- # rubocop: disable CodeReuse/ActiveRecord
def order_options_with_tie_breaker
- {params[:order_by] => params[:sort]}.tap do |order|
- order['id'] ||= 'desc'
- end
+ order_options = { params[:order_by] => params[:sort] }
+ order_options['id'] ||= 'desc'
+ order_options
end
- # rubocop: enable CodeReuse/ActiveRecord
def project_finder_params
finder_params = { without_deleted: true }