diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2016-10-28 11:42:01 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2016-10-28 11:42:01 +0000 |
commit | 5c5f34dd13d43e6ae5c15feb8e1b22db54fff606 (patch) | |
tree | b814a6afd58f29d37d82638ffeba85b54a5948bc /lib | |
parent | 292c982e346843f8979ec5b302a8ad01dd09917a (diff) | |
parent | cae27eae3f80a58bbf7eb49e9d077ea774f2b25a (diff) | |
download | gitlab-ce-5c5f34dd13d43e6ae5c15feb8e1b22db54fff606.tar.gz |
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.rb | 1 |
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 |