summaryrefslogtreecommitdiff
path: root/lib/api/helpers.rb
diff options
context:
space:
mode:
authortiagonbotelho <tiagonbotelho@hotmail.com>2016-07-22 21:57:46 +0100
committertiagonbotelho <tiagonbotelho@hotmail.com>2016-07-22 21:57:46 +0100
commit850813d29867aac5935e1128880784f97071a6d8 (patch)
treed5da375e2dcdaf54d653bc50aa75d2e4dd7f096e /lib/api/helpers.rb
parent2d64bda01f983c43f915e96bd5bf8fcb0790eb0e (diff)
parent08b5bec2fa3beb2880d451a9d9270813b0a22519 (diff)
downloadgitlab-ce-850813d29867aac5935e1128880784f97071a6d8.tar.gz
Merge branch 'master' into filter-branch-by-name
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?