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
Tatuya Kamada
gitlab-ce
Commits
50d3cc2b
Commit
50d3cc2b
authored
Oct 17, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove destroy from environments [ci skip]
parent
18bb0a56
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
14 deletions
+4
-14
app/controllers/projects/environments_controller.rb
app/controllers/projects/environments_controller.rb
+3
-13
config/routes/project.rb
config/routes/project.rb
+1
-1
No files found.
app/controllers/projects/environments_controller.rb
View file @
50d3cc2b
...
...
@@ -2,8 +2,8 @@ class Projects::EnvironmentsController < Projects::ApplicationController
layout
'project'
before_action
:authorize_read_environment!
before_action
:authorize_create_environment!
,
only:
[
:new
,
:create
]
before_action
:authorize_update_environment!
,
only:
[
:edit
,
:update
,
:stop
,
:destroy
]
before_action
:environment
,
only:
[
:show
,
:edit
,
:update
,
:
destroy
]
before_action
:authorize_update_environment!
,
only:
[
:edit
,
:update
,
:stop
]
before_action
:environment
,
only:
[
:show
,
:edit
,
:update
,
:
stop
]
def
index
@scope
=
params
[
:scope
]
...
...
@@ -47,17 +47,7 @@ class Projects::EnvironmentsController < Projects::ApplicationController
def
stop
action
=
@environment
.
stop_action
new_action
=
action
.
active?
?
action
:
action
.
play
(
current_user
)
redirect_to
[
project
.
namespace
.
become
(
Namespace
),
project
,
new_action
]
end
def
destroy
if
@environment
.
destroy
flash
[
:notice
]
=
'Environment was successfully removed.'
else
flash
[
:alert
]
=
'Failed to remove environment.'
end
redirect_to
namespace_project_environments_path
(
project
.
namespace
,
project
)
redirect_to
[
project
.
namespace
.
becomes
(
Namespace
),
project
,
new_action
]
end
private
...
...
config/routes/project.rb
View file @
50d3cc2b
...
...
@@ -318,7 +318,7 @@ resources :namespaces, path: '/', constraints: { id: /[a-zA-Z.0-9_\-]+/ }, only:
end
end
resources
:environments
do
resources
:environments
,
except:
[
:destroy
]
do
member
do
post
:stop
end
...
...
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