summaryrefslogtreecommitdiff
path: root/lib/api/helpers.rb
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2016-07-20 08:55:44 +0200
committerRobert Schilling <rschilling@student.tugraz.at>2016-07-20 08:55:44 +0200
commit839aec1a61b5b8003e27091a871c8988fbf8892c (patch)
tree861afe2f65314730e46ce90e2ea3c5e8a3d8c3b5 /lib/api/helpers.rb
parent1cd573ee7f03bcb356478aab5900fae4618b53ec (diff)
downloadgitlab-ce-839aec1a61b5b8003e27091a871c8988fbf8892c.tar.gz
Replace parse_boolean with to_boolean
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r--lib/api/helpers.rb6
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index d6e4eb2afd7..130509cdad6 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -5,10 +5,6 @@ module API
SUDO_HEADER = "HTTP_SUDO"
SUDO_PARAM = :sudo
- def parse_boolean(value)
- [ true, 1, '1', 't', 'T', 'true', 'TRUE', 'on', 'ON' ].include?(value)
- end
-
def to_boolean(value)
return true if value =~ /^(true|t|yes|y|1|on)$/i
return false if value =~ /^(false|f|no|n|0|off)$/i
@@ -297,7 +293,7 @@ module API
def filter_projects(projects)
# If the archived parameter is passed, limit results accordingly
if params[:archived].present?
- projects = projects.where(archived: parse_boolean(params[:archived]))
+ projects = projects.where(archived: to_boolean(params[:archived]))
end
if params[:search].present?