Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2016-11-14 16:44:27 +0300
committerRobert Schilling <rschilling@student.tugraz.at>2016-11-14 17:22:06 +0300
commit76bd09326fe070d4c865b6fbc1718673d096c178 (patch)
tree51cdbf23ce1e1beeebc84b9e95a5b8f9eeb6ac66 /lib/api/environments.rb
parent36fa5d660df96c49484cd27695da1df6e361eb8f (diff)
Use declared_params helper in API
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