Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-10-27 19:21:09 +0300
committerRémy Coutable <remy@rymai.me>2016-10-27 19:21:09 +0300
commitcae27eae3f80a58bbf7eb49e9d077ea774f2b25a (patch)
tree77d6a4c5093280e0d2eacd6a82acc3cd827fcdbe /lib/api
parentb3210df33e0e4af677666d2044f029c6aeac0d9e (diff)
API: Fix booleans not recognized as such when using the `to_boolean` helper
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/helpers.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index 45120898b76..8025581d3ca 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -6,6 +6,7 @@ module API
SUDO_PARAM = :sudo
def to_boolean(value)
+ return value if [true, false].include?(value)
return true if value =~ /^(true|t|yes|y|1|on)$/i
return false if value =~ /^(false|f|no|n|0|off)$/i