diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2016-11-10 16:32:59 +0100 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2016-11-14 11:17:51 +0100 |
commit | 510092c83ad6b35dc4cc0ac1f15c643952f519b5 (patch) | |
tree | 2925893e0fbc980b8962a72a7004abd1efcfb342 /lib/api/helpers.rb | |
parent | 87cc458a22e0cf91ca5ffe5b988077ec41e59404 (diff) | |
download | gitlab-ce-510092c83ad6b35dc4cc0ac1f15c643952f519b5.tar.gz |
Use #to_h to convert params to a hashgrapify-to-h
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r-- | lib/api/helpers.rb | 5 |
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? |