diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-03-26 12:19:24 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-03-26 12:19:24 +0300 |
commit | bf2727564800adc5b2a7c31a7e8241a392fc673d (patch) | |
tree | 2db39178e0560b6715a439fd4f111901a1ba2aad | |
parent | 9148434e721bd86d9898fbdea3aad15579fb429c (diff) | |
parent | a47565aa14e91841db7e404980df02775d7db90b (diff) |
Merge branch '40843-update-grape-to-v1-0-2-when-it-is-released' into 'master'
Resolve "Update grape to v1.0.2 when it is released"
Closes #40843
See merge request gitlab-org/gitlab-ce!17983
-rw-r--r-- | Gemfile.lock | 4 | ||||
-rw-r--r-- | lib/api/protected_branches.rb | 7 |
2 files changed, 3 insertions, 8 deletions
diff --git a/Gemfile.lock b/Gemfile.lock index a92843f32d8..8a4c1255988 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -357,7 +357,7 @@ GEM signet (~> 0.7) gpgme (2.0.13) mini_portile2 (~> 2.1) - grape (1.0.0) + grape (1.0.2) activesupport builder mustermann-grape (~> 1.0.0) @@ -507,7 +507,7 @@ GEM multi_json (1.13.1) multi_xml (0.6.0) multipart-post (2.0.0) - mustermann (1.0.0) + mustermann (1.0.2) mustermann-grape (1.0.0) mustermann (~> 1.0.0) mysql2 (0.4.10) diff --git a/lib/api/protected_branches.rb b/lib/api/protected_branches.rb index c15c487deb4..c65105ff8b0 100644 --- a/lib/api/protected_branches.rb +++ b/lib/api/protected_branches.rb @@ -52,12 +52,7 @@ module API conflict!("Protected branch '#{params[:name]}' already exists") end - # Replace with `declared(params)` after updating to grape v1.0.2 - # See https://github.com/ruby-grape/grape/pull/1710 - # and https://gitlab.com/gitlab-org/gitlab-ce/issues/40843 - declared_params = params.slice("name", "push_access_level", "merge_access_level", "allowed_to_push", "allowed_to_merge") - - api_service = ::ProtectedBranches::ApiService.new(user_project, current_user, declared_params) + api_service = ::ProtectedBranches::ApiService.new(user_project, current_user, declared(params)) protected_branch = api_service.create if protected_branch.persisted? |