diff options
author | Matija Čupić <matteeyah@gmail.com> | 2018-01-23 19:24:55 +0100 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2018-02-05 18:58:17 +0100 |
commit | cc2bed9283039db726f42184ea635f057534205f (patch) | |
tree | faee9281088f8975c60edd4650c614cf319d05dc /app/controllers | |
parent | edbe911b04465f0e6c72e102d083d0e85848a552 (diff) | |
download | gitlab-ce-cc2bed9283039db726f42184ea635f057534205f.tar.gz |
Port #save_multiple to Groups::VariablesController
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/groups/variables_controller.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/app/controllers/groups/variables_controller.rb b/app/controllers/groups/variables_controller.rb index 10038ff3ad9..3c303b64b65 100644 --- a/app/controllers/groups/variables_controller.rb +++ b/app/controllers/groups/variables_controller.rb @@ -31,6 +31,16 @@ module Groups end end + def save_multiple + respond_to do |format| + format.json do + return head :ok if @group.update(variables_params) + + head :bad_request + end + end + end + def destroy if variable.destroy redirect_to group_settings_ci_cd_path(group), @@ -49,8 +59,12 @@ module Groups params.require(:variable).permit(*variable_params_attributes) end + def variables_params + params.permit(variables_attributes: [*variable_params_attributes]) + end + def variable_params_attributes - %i[key value protected] + %i[id key value protected _destroy] end def variable |