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
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2016-10-28 14:42:01 +0300
committerSean McGivern <sean@mcgivern.me.uk>2016-10-28 14:42:01 +0300
commit5c5f34dd13d43e6ae5c15feb8e1b22db54fff606 (patch)
treeb814a6afd58f29d37d82638ffeba85b54a5948bc /lib
parent292c982e346843f8979ec5b302a8ad01dd09917a (diff)
parentcae27eae3f80a58bbf7eb49e9d077ea774f2b25a (diff)
Merge branch '23890-api-should-accepts-boolean' into 'master'
API: Fix booleans not recognized as such when using the `to_boolean` helper Fixes #22831 Fixes #23890 See merge request !7149
Diffstat (limited to 'lib')
-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