summaryrefslogtreecommitdiff
path: root/lib/api/helpers.rb
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-11-14 13:15:58 +0000
committerRémy Coutable <remy@rymai.me>2016-11-14 13:15:58 +0000
commit36fa5d660df96c49484cd27695da1df6e361eb8f (patch)
tree8709c9e4945fb00cd0d57884f8126fb4dc077a99 /lib/api/helpers.rb
parent7e34f7fcfc802dccae71f38d75707ea49e5fb4e9 (diff)
parent510092c83ad6b35dc4cc0ac1f15c643952f519b5 (diff)
downloadgitlab-ce-36fa5d660df96c49484cd27695da1df6e361eb8f.tar.gz
Merge branch 'grapify-to-h' into 'master'
Use to_h to convert params to a hash See merge request !7406
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r--lib/api/helpers.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index 3c9d7b1aaef..6998b6dc039 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -23,6 +23,11 @@ module API
warden.try(:authenticate) if %w[GET HEAD].include?(env['REQUEST_METHOD'])
end
+ def declared_params(options = {})
+ options = { include_parent_namespaces: false }.merge(options)
+ declared(params, options).to_h.symbolize_keys
+ end
+
def find_user_by_private_token
token = private_token
return nil unless token.present?