From 9dfbfbb2d10dfc6297acff1b59dfbaf43b848d96 Mon Sep 17 00:00:00 2001
From: Robert Schilling <rschilling@student.tugraz.at>
Date: Thu, 24 Nov 2016 13:30:53 +0100
Subject: [PATCH] Don't convert data which already is the target type

---
 lib/api/commit_statuses.rb | 2 +-
 lib/api/commits.rb         | 2 +-
 lib/api/groups.rb          | 2 +-
 lib/api/variables.rb       | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/api/commit_statuses.rb b/lib/api/commit_statuses.rb
index f54d4f06627..492884d162b 100644
--- a/lib/api/commit_statuses.rb
+++ b/lib/api/commit_statuses.rb
@@ -77,7 +77,7 @@ module API
         )
 
         begin
-          case params[:state].to_s
+          case params[:state]
           when 'pending'
             status.enqueue!
           when 'running'
diff --git a/lib/api/commits.rb b/lib/api/commits.rb
index 0319d076ecb..2670a2d413a 100644
--- a/lib/api/commits.rb
+++ b/lib/api/commits.rb
@@ -48,7 +48,7 @@ module API
         requires :id, type: Integer, desc: 'The project ID'
         requires :branch_name, type: String, desc: 'The name of branch'
         requires :commit_message, type: String, desc: 'Commit message'
-        requires :actions, type: Array, desc: 'Actions to perform in commit'
+        requires :actions, type: Array[Hash], desc: 'Actions to perform in commit'
         optional :author_email, type: String, desc: 'Author email for commit'
         optional :author_name, type: String, desc: 'Author name for commit'
       end
diff --git a/lib/api/groups.rb b/lib/api/groups.rb
index 48ad3b80ae0..fc39fdf4b67 100644
--- a/lib/api/groups.rb
+++ b/lib/api/groups.rb
@@ -33,7 +33,7 @@ module API
 
         groups = groups.search(params[:search]) if params[:search].present?
         groups = groups.where.not(id: params[:skip_groups]) if params[:skip_groups].present?
-        groups = groups.reorder(params[:order_by] => params[:sort].to_sym)
+        groups = groups.reorder(params[:order_by] => params[:sort])
 
         present paginate(groups), with: Entities::Group
       end
diff --git a/lib/api/variables.rb b/lib/api/variables.rb
index 90f904b8a12..f623b1dfe9f 100644
--- a/lib/api/variables.rb
+++ b/lib/api/variables.rb
@@ -30,7 +30,7 @@ module API
       end
       get ':id/variables/:key' do
         key = params[:key]
-        variable = user_project.variables.find_by(key: key.to_s)
+        variable = user_project.variables.find_by(key: key)
 
         return not_found!('Variable') unless variable
 
-- 
GitLab