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
c7350f0c
Commit
c7350f0c
authored
Nov 15, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Select recently updated environments for auto-close
parent
54c2e234
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
app/models/environment.rb
app/models/environment.rb
+4
-0
app/models/project.rb
app/models/project.rb
+2
-2
No files found.
app/models/environment.rb
View file @
c7350f0c
...
...
@@ -37,6 +37,10 @@ class Environment < ActiveRecord::Base
state
:stopped
end
def
recently_updated_on?
(
ref
)
ref
.
to_s
==
last_deployment
.
ref
end
def
last_deployment
deployments
.
last
end
...
...
app/models/project.rb
View file @
c7350f0c
...
...
@@ -1299,9 +1299,9 @@ class Project < ActiveRecord::Base
envs
=
environments
.
available
.
where
(
id:
environment_ids
)
if
commit
envs
.
select
{
|
env
|
env
.
includes_commit?
(
commit
)
}
envs
.
select
{
|
env
ironment
|
env
.
includes_commit?
(
commit
)
}
else
envs
.
to_a
envs
.
select
{
|
environment
|
env
.
recently_updated_on?
(
ref
)
}
end
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