summaryrefslogtreecommitdiff
path: root/lib/api/environments.rb
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2016-11-14 14:44:27 +0100
committerRobert Schilling <rschilling@student.tugraz.at>2016-11-14 15:22:06 +0100
commit76bd09326fe070d4c865b6fbc1718673d096c178 (patch)
tree51cdbf23ce1e1beeebc84b9e95a5b8f9eeb6ac66 /lib/api/environments.rb
parent36fa5d660df96c49484cd27695da1df6e361eb8f (diff)
downloadgitlab-ce-76bd09326fe070d4c865b6fbc1718673d096c178.tar.gz
Use declared_params helper in APIgrapify-declared-params
Diffstat (limited to 'lib/api/environments.rb')
-rw-r--r--lib/api/environments.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/api/environments.rb b/lib/api/environments.rb
index 819f80d8365..00c901937b1 100644
--- a/lib/api/environments.rb
+++ b/lib/api/environments.rb
@@ -32,8 +32,7 @@ module API
post ':id/environments' do
authorize! :create_environment, user_project
- create_params = declared(params, include_parent_namespaces: false).to_h
- environment = user_project.environments.create(create_params)
+ environment = user_project.environments.create(declared_params)
if environment.persisted?
present environment, with: Entities::Environment
@@ -55,8 +54,8 @@ module API
authorize! :update_environment, user_project
environment = user_project.environments.find(params[:environment_id])
-
- update_params = declared(params, include_missing: false).extract!(:name, :external_url).to_h
+
+ update_params = declared_params(include_missing: false).extract!(:name, :external_url)
if environment.update(update_params)
present environment, with: Entities::Environment
else