diff options
author | Rémy Coutable <remy@rymai.me> | 2016-10-27 18:21:09 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-10-27 18:21:09 +0200 |
commit | cae27eae3f80a58bbf7eb49e9d077ea774f2b25a (patch) | |
tree | 77d6a4c5093280e0d2eacd6a82acc3cd827fcdbe /lib/api/helpers.rb | |
parent | b3210df33e0e4af677666d2044f029c6aeac0d9e (diff) | |
download | gitlab-ce-cae27eae3f80a58bbf7eb49e9d077ea774f2b25a.tar.gz |
API: Fix booleans not recognized as such when using the `to_boolean` helper23890-api-should-accepts-boolean
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'lib/api/helpers.rb')
-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 |