diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-11-15 16:48:14 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-11-15 16:48:14 +0300 |
commit | c7350f0c62dee6ffc43cf24004ed95e399d72832 (patch) | |
tree | a086068c3736d2ef5428336f641267a9d7fc6f00 /app/models/environment.rb | |
parent | 54c2e234f491fa4b94f40cc997544a029b28d7b8 (diff) |
Select recently updated environments for auto-close
Diffstat (limited to 'app/models/environment.rb')
-rw-r--r-- | app/models/environment.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/environment.rb b/app/models/environment.rb index 67812b12993..fe3df473d73 100644 --- a/app/models/environment.rb +++ b/app/models/environment.rb @@ -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 |