Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
e255e4de
Commit
e255e4de
authored
Jul 04, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ayufan nice catches
parent
2dd9a9af
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
14 deletions
+22
-14
app/controllers/groups/variables_controller.rb
app/controllers/groups/variables_controller.rb
+11
-7
app/controllers/projects/variables_controller.rb
app/controllers/projects/variables_controller.rb
+11
-7
No files found.
app/controllers/groups/variables_controller.rb
View file @
e255e4de
...
...
@@ -20,9 +20,9 @@ module Groups
end
def
create
new_variable
=
Ci
::
GroupVariable
.
new
(
group_params
)
new_variable
=
group
.
variables
.
create
(
group_params
)
if
new_variable
.
valid?
&&
group
.
variables
<<
new_variable
if
new_variable
.
persisted?
redirect_to
group_settings_ci_cd_path
(
group
),
notice:
'Variables were successfully updated.'
else
...
...
@@ -32,11 +32,15 @@ module Groups
end
def
destroy
variable
.
destroy
redirect_to
group_settings_ci_cd_path
(
group
),
status:
302
,
notice:
'Variable was successfully removed.'
if
variable
.
destroy
redirect_to
group_settings_ci_cd_path
(
group
),
status:
302
,
notice:
'Variable was successfully removed.'
else
redirect_to
group_settings_ci_cd_path
(
group
),
status:
302
,
notice:
'Failed to remove the variable'
end
end
private
...
...
app/controllers/projects/variables_controller.rb
View file @
e255e4de
...
...
@@ -21,9 +21,9 @@ class Projects::VariablesController < Projects::ApplicationController
end
def
create
new_variable
=
Ci
::
Variable
.
new
(
project_params
)
new_variable
=
project
.
variables
.
create
(
project_params
)
if
new_variable
.
valid?
&&
@project
.
variables
<<
new_variable
if
new_variable
.
persisted?
redirect_to
namespace_project_settings_ci_cd_path
(
project
.
namespace
,
project
),
notice:
'Variables were successfully updated.'
else
...
...
@@ -33,11 +33,15 @@ class Projects::VariablesController < Projects::ApplicationController
end
def
destroy
variable
.
destroy
redirect_to
namespace_project_settings_ci_cd_path
(
project
.
namespace
,
project
),
status:
302
,
notice:
'Variable was successfully removed.'
if
variable
.
destroy
redirect_to
namespace_project_settings_ci_cd_path
(
project
.
namespace
,
project
),
status:
302
,
notice:
'Variable was successfully removed.'
else
redirect_to
namespace_project_settings_ci_cd_path
(
project
.
namespace
,
project
),
status:
302
,
notice:
'Failed to remove the variable'
end
end
private
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment